auth0-angularjs-sample icon indicating copy to clipboard operation
auth0-angularjs-sample copied to clipboard

The profile attributes not getting passed

Open sivan123 opened this issue 9 years ago • 3 comments

It seems that the profile attributes (name, email, roles etc) are not being passed in the jwt when making the server call. So the spring backend cannot resolve these and return UNKNOWN_USER. Is there any other config to be done to make this happen?

sivan123 avatar Aug 26 '16 00:08 sivan123

Do you mean that this information is not being included in the JWT payload? Have you inspected your JWT to make sure it's there?

chenkie avatar Aug 27 '16 16:08 chenkie

@chenkie This really should be included in all the examples but most importantly in the Custom Login example.

I couldn't find this in the new docs or examples anywhere and took me a while to guess the right "format" for providing this even though it might be "obvious" for those who have used Auth0 for a while.

Anyway, assuming you are using a Custom Login page you can use this which is exactly the same as the Custom Login example with the addition of the scope property being added to the object in the login method call (with whatever scope objects you're looking for from the user profile):

function login(username, password, callback) {
            angularAuth0.login({
                connection: 'Username-Password-Authentication',
                responseType: 'token',
                email: username,
                password: password,
                scope: 'openid email roles',
            }, callback);
        }

Without the scope property none of the profile properties are including the JWT token payload.

MattWood21 avatar Nov 10 '16 05:11 MattWood21

@Padagi Thank's man, you saved my day. I think that developers need to add more examples depend on custom login and using Auth0 without Lock module.

ReaktorDTR avatar Jan 29 '17 14:01 ReaktorDTR