auth0-samples / auth0-angularjs-sample

These samples are made up of steps to add Auth0 to an Angular JS app
28 stars 111 forks source link

The profile attributes not getting passed #15

Open sivan123 opened 8 years ago

sivan123 commented 8 years ago

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?

chenkie commented 8 years ago

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?

MattWood21 commented 7 years ago

@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.

ReaktorDTR commented 7 years ago

@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.