2

I am using auth0-jwt to handle authentication:

this.auth0.parseHash((err, authResult) => {
  if (authResult && authResult.accessToken && authResult.idToken) {
    window.location.hash = '';
    this.setSession(authResult);
    this.router.navigate(['/']);
  } else if (err) {
    this.router.navigate(['/']);
  }
});

However, while window.location.hash contains authResult: #access_token=qwe&expires_in=7200&token_type=Bearer&state=zbc&id_token=xyz, auth0.parseHash returns invalid token and authResult is undefined I am using : "@auth0/angular-jwt": "^1.0.0-beta.9", "auth0-js": "^9.2.2"

Yuvals
  • 3,094
  • 5
  • 32
  • 60
  • Hi Yuvals - did you solve this? I keep getting an invalid_token error: ```{error: "invalid_token", errorDescription: "Issuer DOMAIN is not valid."}``` – Jackson Vaughan Nov 14 '18 at 23:16
  • @JackVaughan if you are using social login such as Facebook, make sure you use your own app credential, and not what is in the example of Auth0. I believe that was my issue. – Yuvals Nov 15 '18 at 18:36
  • if not, make sure you define the correct domain on both auth0 and your app – Yuvals Nov 15 '18 at 18:36
  • Thanks for the reply @Yuvals - turns out my domain was wrong. – Jackson Vaughan Nov 17 '18 at 01:06

1 Answers1

0

The problem was using wrong Domain for both application and what is defined on Auth0

Yuvals
  • 3,094
  • 5
  • 32
  • 60