We have a very detailled level of authorization set-up for our API. Currently using the authorization-extension of auth0 to manage all of these authorizations. It can very well be that a single user receives up to 20 groups, 10 roles and 100 permissions. We need all of this information available in the API to do granular authorization. However, placing all of this information in the token could generate very large tokens, which the documentation also discourages. So, instead, we’ve turned the ‘Persistence’ switch on in the authorization-extension configuration
Now, after receiving an access token, when I do a call to https://example.eu.auth0.com/userinfo I would expect to get the app_metadata
section in there as well. However this the actual response:
{"sub":"auth0|591xxx131a3","name":"sdegroot@mydomain","nickname":"sdegroot","picture":"https://s.gravatar.com/avatar/0b20cee90fb35eb54a6426808b89aa01?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fsd.png","updated_at":"2017-05-18T10:55:38.425Z"}
While I am using this as auth
configurations for Lock:
auth: {
redirectUrl: 'http://localhost:2000/auth0.html',
responseType: 'token',
sso: true,
params: {
audience: 'my-api-audience-name',
scope: 'openid profile test:test groups permissions roles'
}
}
The interesting thing, is in the documentation it mentions this:
You can also store the authorization
context information in the user
profile. The data will be stored in
the user’s app_metadata and you can
then use the Management API or the
/userinfo endpoint to retrieve this
information after the user has logged
in.
However this doesn’t seem to work. How do you guys recommend me to proceed with this?
Thanks in advance!