Does anybody know how I can return the user firstname instead of the email upon a successful login?
If you request the scope profile you’ll get the user’s name.
Hi,
My app has API scopes for okta.users.read and
so I changed the code to be document.getElementById("messageBox").innerHTML = "Hello, " + idToken.claims.firstName+ "! You just logged in! :)";
But that returns Undefined! What am I doing wrong?
okta.users.read is an Okta scope for managing users via the API. Try requesting just the scope profile.
Hi, I dont see just a profile scope, can you advise where this is?
It’s one of the default OpenID Connect scopes.
https://developer.okta.com/docs/reference/api/oidc/#reserved-scopes
I didn’t need to add the scope. I needed to add a claim for the firstname
I have a basic question here. If I am writing an app for my customers to log in via SSO, does it matter whether I choose SAML or OIDC? If my customers use Okta as an IdP and they use SAML, can I still choose OIDC in my app’s integration with Okta and still allow those customers to login via SSO?
Yes, both OIDC and SAML will work. However, we recommend you choose OIDC because it’s a newer standard that works with more devices. SAML 2.0 was released in 2006 and is more difficult to work with for developers.