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

OIDC auth in 0.16.2 fails with "Failed to decode id token claims" #744

Closed
kyhwana opened this issue Aug 16, 2022 · 8 comments
Closed

OIDC auth in 0.16.2 fails with "Failed to decode id token claims" #744

kyhwana opened this issue Aug 16, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@kyhwana
Copy link
Contributor

kyhwana commented Aug 16, 2022

Bug description
After upgrading from 0.16.0 to 0.16.2 users are unable to authenticate using azure oidc, they get the error Failed to decode id token claims
In the logs is the following error:

Aug 16 14:16:32 <machinefqd>  headscale[1125980]: 2022-08-16T02:16:32Z ERR home/runner/work/headscale/headscale/oidc.go:324 > Failed to decode id token claims error="json: Unmarshal(non-pointer headscale.IDTokenClaims)"

Is this related to the changed line in oidc.go? if err := idToken.Claims(claims); err != nil {
To Reproduce

Have a user log out of the tailscale client then reauthenticate, using Azure AD OIDC. When the browser window opens it will attempt to auth via AAD and fail with the above error.

Context info
Headscale version 0.16.2.
tailscale client version 1.28.0

@kyhwana kyhwana added the bug Something isn't working label Aug 16, 2022
@mannp
Copy link

mannp commented Aug 16, 2022

Just had the same issue here with a previously working keycloak instance.

2022-08-16T14:03:08Z ERR go/src/headscale/oidc.go:324 > Failed to decode id token claims error="json: Unmarshal(non-pointer headscale.IDTokenClaims)"

@victorhooi
Copy link

Yup, I have the same issue as well on 0.16.2, and am getting the same error message.

I'm using OIDC with Google OAuth.

Is there some workaround we can use for now, or is this relatively easy to patch?

@mannp
Copy link

mannp commented Aug 17, 2022

I went back to 0.16.1 and did have the same error, so went back to 0.16.0 and was able to login correctly.

juanfont added a commit that referenced this issue Aug 17, 2022
juanfont added a commit that referenced this issue Aug 17, 2022
Fix error decoding OIDC claims (#744)
@juanfont
Copy link
Owner

Hey people, we have merged a fix in main already.

Can you give a try before we release 0.16.3?

@victorhooi
Copy link

I'm willing to try - is there a place we can download latest built binaries? (AMD64 in my case).

@mannp
Copy link

mannp commented Aug 17, 2022

Still using docker and some Kubernetes for all of my infra, so not so easy to try without a pre-release docker img (which I appreciate is a hassle to create each time).

@kyhwana
Copy link
Contributor Author

kyhwana commented Aug 17, 2022

I built the main repo and updated.
When logging a user out (windows client) and then logging back in via oidc azure AD, I get the error
Aug 18 09:49:46 <headscalehost> headscale[1601506]: 2022-08-17T21:49:46Z DBG Machine registration has expired. Sending a authurl to register machine=<machine name>
Deleting the machine (which headscale nodes list says is expired?) and then reauthenticating works OK.

@juanfont
Copy link
Owner

@kyhwana thanks for checking out. I will close this issue and open a new one on the registration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants