# Get public profile url at /userInfo

**URL:** <https://community.auth0.com/t/get-public-profile-url-at-userinfo/11442>\
**Category:** Get Help\
**Tags:** userinfo, hosted-login-page, scopes\
**Created:** [May 8, 2018, 12:41pm UTC](https://community.auth0.com/t/get-public-profile-url-at-userinfo/11442 "2018-05-08T12:41:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![harald.andertun](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/harald.andertun/32/7093_2.png) [@harald.andertun](https://community.auth0.com/u/harald.andertun)\
**Post date:** [May 8, 2018, 12:41pm UTC](https://community.auth0.com/t/get-public-profile-url-at-userinfo/11442/1 "2018-05-08T12:41:02Z")

</div>

I initialise auth0 like this

```
angularAuth0Provider.init({
    clientID: __env.auth0.clientId,
    domain: __env.auth0.domain,
    responseType: 'token id_token',
    audience: 'https://' + __env.auth0.domain + '/userinfo',
    redirectUri: __env.auth0.redirectUrl,
    scope: 'openid email profile user_metadata app_metadata'
})

```

I send the user to the hosted login page by calling `.authorize(...)`

```
angularAuth0.authorize({
    allowed_connections: ['linkedin', 'facebook', 'google-oauth2', 'windowslive', 'email'],
});

```

The lock at the hosted login page is initialized like this

```
var allowed_connections = config.extraParams.allowed_connections;
var lock = new Auth0LockPasswordless(config.clientID, config.auth0Domain, {
  auth: {
    redirectUrl: config.callbackURL,
    responseType: (config.internalOptions || {}).response_type ||
      (config.callbackOnLocationHash ? 'token' : 'code'),
    params: config.internalOptions
  },
  assetsUrl: config.assetsUrl,
  allowedConnections: allowed_connections ? allowed_connections : null,
  closable: false,
  socialButtonStyle: 'small'
});

```

When user has returned to the callback page, I parse the hash and call .userInfo()

```
angularAuth0.parseHash(function(err, authResult) {
    if (authResult && authResult.accessToken) {
        angularAuth0.client.userInfo(authResult.accessToken, function (error, user) {
            console.log(user);
        });

    } else if (err) {
        console.log(err);
    }
});

```

where `user` looks like this

```
{
  "sub": "linkedin|...",
  "given_name": "...",
  "family_name": "...",
  "nickname": "...",
  "name": "...",
  "picture": "https://media.licdn.com/dms/image/...",
  "updated_at": "2018-05-08T11:36:53.273Z",
  "email": "...",
  "email_verified": true
}

```

When looking at the Raw JSON at the [online user management](https://manage.auth0.com) I can see a lot more info, e.g. `publicProfileUrl`.  
**How do I get that info?**

---

<div class="post-metadata">

**Author:** ![sgmeyer](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sgmeyer/32/3387_2.png) [@sgmeyer](https://community.auth0.com/u/sgmeyer)\
**Post date:** [May 8, 2018, 12:52pm UTC](https://community.auth0.com/t/get-public-profile-url-at-userinfo/11442/2 "2018-05-08T12:52:26Z")

</div>

@harald.andertun whenever you specify an audience with auth0 or mark a client as OIDC conformant Auth0 only supports certain scopes for returning data in the `id_token` or at the `/userinfo` endpoint. Specifically we only support these scopes:

> **[Final: OpenID Connect Core 1.0 incorporating errata set 1](https://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims)**
>
> OpenID Connect Core 1.0 incorporating errata set 1

There is a workaround for this. Inside a rule you can add additional claims to the `id_token`, but there is no way to augment what is returned at the `/userinfo` endpoint beyond the scopes listed in the specification. Here is what you can do to augment the `id_token` to fetch `app_metadata` and `user_metadata`:

```auto
context.idToken['https://example.com/claims/app_metadata'] = user.app_metadata;
context.idToken['https://example.com/claims/user_metadata'] = user.user_metadata;

```

The `id_token` is an optimization in that it will contain at least the same information as returned by `/userinfo` and auth0 provides a way to augment the token with additional claims. The key here is the claims will need to be namespaced with a URL, otherwise Auth0 will remove those when using an OIDC Conformant application.

Since you react app is already requesting metadata scopes and the `id_token` you don’t need to do much more. However, in the rule you can wrap the above code in an `if` statement that only adds that data if requested by the client (via scopes) and authorized by Auth0.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 25, 2019, 1:06pm UTC](https://community.auth0.com/t/get-public-profile-url-at-userinfo/11442/3 "2019-07-25T13:06:09Z")

</div>


