EmployeeNumber in aspnet Oktahost Sample

All I am really trying to do is read the employeeNumber stored in the Okta user profile. I am currently using the aspnet mvc example. Something like this should not be very difficult, however I am having issues finding any sort of useful information in asp.net. Any information or assistance would be appreciated.

Thank you!

Are you able to successfully authenticate via the sample app and confirm you are receiving ID/Access tokens? I am assuming the employeeNumber is a custom attribute on the profile?


I am able to authenticate just fine. I am able to pull up the Profile tab, which lists all of the claims, which makes sense to me. However the employeeNumber field is not listed. This field is part of the built-in list of fields; ie. I did not manually create the field myself. I did manually add a number to it in order to test, but that was it.

Which scopes are you defining in the config? It might only be accessible via the /userinfo endpoint - You should see a call to /userinfo if you open up the dev tools and look at the network tab. See: OpenID Connect & OAuth 2.0 API | Okta Developer

We got it figured out, and you were right on track! I hadn’t added my employeeNumber scope to the list of scopes in Startup.cs. After modifying my line to look like:
Scope = new List {“openid”, “profile”, “email”, “employeeNumber”}

Everything worked as expected!

Thank you for your time!