
StoneS.70407 (Customer) asked a question.
How do I get what access a user has when they sign in to my single page app (SPA) through Okta? I got Okta working in my front-end app using the @okta/okta-auth-js and @okta/okta-react NPM libraries. And I call the https://dev-XXXXXXXX.okta.com/oauth2/default/v1/userinfo endpoint using oktaAuth.getUser() and it returns me:
{
"sub":"XXXXXXXXXXXXXXXXXXXX",
"name":"Joe Smith",
"locale":"en_US",
"email":"joeSmith@example.com",
"preferred_username":"joeSmith@example.com",
"given_name":"Joe",
"family_name":"Smith",
"zoneinfo":"America/Los_Angeles",
"updated_at":1654829975,
"email_verified":true
}
and I was hoping it would also return what scopes the user has access to so that I could render the navigation bar according to their permissions. Is there a scope that I could add to the OktaAuth that would return that information?
const oktaAuth = new OktaAuth({
issuer: issuer,
clientId: clientId,
redirectUri: signInRedirect,
scopes: ['openid','profile','email'] // add some scope for supported user access/permissions/scopes?
})
Or another endpoint that would give me that information?
Additionally, I would prefer an endpoint that the frontend could call directly to the Okta API if that is possible. If it isn't I might have to create a microservice for the frontend to call and relays the call to an non-cors Okta endpoint.

Found it. I was over thinking it.
const { authState, oktaAuth } = useOktaAuth()
It is in the authState.idToken.scopes.