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

HS256 not supported #30

Closed
namel opened this issue May 23, 2017 · 9 comments
Closed

HS256 not supported #30

namel opened this issue May 23, 2017 · 9 comments

Comments

@namel
Copy link

namel commented May 23, 2017

authentication fails, console indicates error:
"invalid_token" "Algorithm HS256 is not supported. (Expected algs: [RS256])"

I found a workaround to this on issue: auth0/auth0.js#303

but since this is a sample app, it should work right out-of-the-box

@chenkie
Copy link
Contributor

chenkie commented May 23, 2017

Hi @namel

Which sample in particular did you get the error in?

@namel
Copy link
Author

namel commented May 23, 2017

it was on 01-Login

@chenkie
Copy link
Contributor

chenkie commented May 23, 2017

Did you make any changes to the config in the AuthService? The reason I ask is that with the configuration that's there, it should force the ID token to be signed with RS256.

@namel
Copy link
Author

namel commented May 23, 2017

No I did not. After applying the workaround described above, I'm now getting an error that the token is signed in the future, even though my time is set automatically over the network.

This could be related do my environment though? I'm on the Linux Subsystem for Windows. Another thing that fails on this environment is that the uniqid package fails (see microsoft/WSL#468)

@chenkie
Copy link
Contributor

chenkie commented May 23, 2017

for issues with system clocks you can add the leeway option in your WebAuth config. I'd start with 5 seconds.

auth0 = new auth0.WebAuth({
  // ...
  leeway: 5
});

@chenkie
Copy link
Contributor

chenkie commented May 23, 2017

Also can you check which "Client Type" you have set in the clients settings in the Auth0 dashboard?

@ssaso
Copy link

ssaso commented May 29, 2017

@namel choosing single-page-app in "Client Type" solved my problem

@namel namel closed this as completed Jun 1, 2017
@sinedsem
Copy link

sinedsem commented Aug 3, 2017

Yes!! To solve invalid_token error with description
Algorithm HS256 is not supported. (Expected algs: [RS256])
one should set "Client Type" at https://manage.auth0.com/#/clients to Single Page Application

@schwer
Copy link

schwer commented Apr 11, 2018

Why does this work?

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

No branches or pull requests

5 participants