Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth0 user returns 'sub' parameter instead of user_id #24

Open
elliot-sawyer opened this issue Jul 20, 2022 · 1 comment · May be fixed by #25
Open

Auth0 user returns 'sub' parameter instead of user_id #24

elliot-sawyer opened this issue Jul 20, 2022 · 1 comment · May be fixed by #25

Comments

@elliot-sawyer
Copy link

When I log in with Auth0, the response contains a sub parameter instead of the expected user_id parameter shown in Auth0ResourceOwner. Am I using Auth0 incorrectly, or has something changed recently (due to the purchase by Okta?)

    public function getId()
    {
        return $this->getValueByKey($this->response, 'user_id');
    }

I could probably work around that by tweaking this method to check for user_id, then sub if user_id isn't found. If that's an acceptable solution I can raise a PR.

@elliot-sawyer
Copy link
Author

From the docs: https://auth0.com/docs/get-started/apis/scopes/openid-connect-scopes#standard-claims

openid (required) Returns the sub claim, which uniquely identifies the user. In an ID Token, iss, aud, exp, iat, and at_hash claims will also be present. To learn more about the ID Token claims, read ID Token Structure.

elliot-sawyer added a commit to elliot-sawyer/oauth2-auth0 that referenced this issue Jul 20, 2022
@elliot-sawyer elliot-sawyer linked a pull request Jul 20, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant