openid - how to get claims from userinfo endpoint without including them in id token -


i'm having trouble trying figure out how use userinfo endpoint. example uses identity server 4 authorization server.

let's have js app displays authenticated user's location. let's assume have user store provides claims including users' location. iprofileservice interface has been implemented getprofiledataasync retrieves users claims user store user.

the js app needs have access user's location claim. 1 way add identityresource ids e.g.

new identityresource("test", new [] {"location"})

then add scope js client e.g.

new client {     clientid = "js",     allowedscopes =     {         identityserverconstants.standardscopes.openid,         "test"     } } 

then configure oidc library request scope e.g.

var config = {    authority: "http://localhost:5000",    client_id: "js",    redirect_uri: "http://localhost:5003/callback.html",    response_type: "id_token token",    scope:"openid test",    post_logout_redirect_uri : "http://localhost:5003/index.html", }; 

doing mean id_token contain location claim , accessible part of users' profile. same claim returned when calling userinfo endpoint access token received during authentication.

however have repeatedly read (here, instance) should put few claims possible in identity token , use userinfo endpoint retrieve additional claims. linked article seems imply behavior available default in identity server.

so in order that, using example code mentioned above, i'd remove 'test' scope requested scopes oidc config. means id token no longer populated location claim. when userinfo endpoint called, 'test' scope not in access token, location claim not put in response.

basically question how supposed ask claims omitted id token, returned userinfo endpoint?

the oidc spec seems imply should able request specific claims using "claims" request parameter, cant find documentation around identity server (or auth0 matter).

if request identity token only, claims in token. if request both id_token , token, basic claims in id_token, , other claims can retrieved userinfo endpoint.

this spec suggests.

https://leastprivilege.com/2016/12/14/optimizing-identity-tokens-for-size/


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -