Okta Node JS OIDC Middlware - and APP profile fields

Hi

I have a web app with additional profile fields, can I get these values from the Okta Node JS OIDC Middlware libraries?

I can authenticate and show basic fields like name, email etc.

Please advise
Thanks

const oidc = new ExpressOIDC({
issuer: ISSUER,
client_id: CLIENT_ID,
client_secret: CLIENT_SECRET,
appBaseUrl: CALLBACK_URL,
scope: ‘openid profile’
});

console.log(req.userContext.userinfo.name);
console.log(req.userContext.userinfo.ename);

Do I need to call the Okta API in general and maybe use with the authenticated user on the app?

Like this:

Get Assigned User for App → {{url}}/api/v1/apps/{{appId}}/users/{{userId}}

(would be nice if values could be extracted now that user is autenticatin on the app)

Thanks

If I understand your question correctly, I think you’re looking for the /userinfo endpoint

1 Like

I am using /userinfo but it does not contain my additional attributes definded/added under the user on my app :frowning:

I am using “xxxxx/v1/userinfo”

Thanks

Are you using a custom authorization server?

Hi

No custom auth server, I am authenticating user with

var authorization_endpoint = “https://xxxxx.okta.com/oauth2/v1/authorize
var token_endpoint = “https://xxxxx.okta.com/oauth2/v1/token
var introspection_endpoint = “https://xxxxx.okta.com/oauth2/v1/introspect

and mapping to:

type Okta_Introspection struct {
Active bool json:"active"
Scope string json:"scope"
Username string json:"username"
Exp int json:"exp"
Iat int json:"iat"
Sub string json:"sub"
Aud string json:"aud"
Iss string json:"iss"
Jti string json:"jti"
TokenType string json:"token_type"
ClientID string json:"client_id"
UID string json:"uid"
}

Thanks
Felix

Wait I think this might be working now, let me get back!

Thanks
Felix