Skip to content
This repository has been archived by the owner on Feb 21, 2020. It is now read-only.

Response doesn't seem correct for the example #15

Open
trepidity opened this issue Jan 29, 2018 · 1 comment
Open

Response doesn't seem correct for the example #15

trepidity opened this issue Jan 29, 2018 · 1 comment

Comments

@trepidity
Copy link

If I use just the example, straight from a clone, it fails. At least when I tried with Google and Facebook. From what I could tell, the response wasn't encoded, but just a JWT.

To get the example to work, I had to add/change response_type, scope, nonce, audience to the startAsync call.
Can someone confirm this or why and if so I will submit a PR.

My modified piece

  _loginWithAuth0 = async () => {
    const redirectUrl = AuthSession.getRedirectUrl();
    console.log(`Redirect URL (add this to Auth0): ${redirectUrl}`);
    const result = await AuthSession.startAsync({
      authUrl: `${auth0Domain}/authorize` + toQueryString({
        client_id: auth0ClientId,
        response_type: 'id_token',
        scope: 'openid email profile',
        audience: 'https://example.auth0.com/userinfo',
        nonce: await this.getNonce(),
        redirect_uri: redirectUrl,
      }),
    });
@arielweinberger
Copy link
Contributor

@trepidity

@OscarKolsrud
I've created a pull request with the up-to-date code to also be able to run expo start (supports latest SDK).

Also supports the new request/response structure of auth0.

#26

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants