JetBrains / teamcity-azure-active-directory

TeamCity plugin which supports authentication via Microsoft Azure Active Directory
Apache License 2.0
26 stars 19 forks source link

Error: Some of required claims were not found in parsed JWT #44

Closed SteppingHat closed 4 years ago

SteppingHat commented 5 years ago

I've gone ahead and setup the bare minimum basic config. Upon clicking the sign in with azure button, I can see in the azure portal that the sign-in was successful, however when redirected back to TeamCity the following message is displayed:

400 Some of required claims were not found in parsed JWT. nonce - 8CE58EA3686B64CF43D05A689FB819F7; name - null, oid - null

I have assured that the URL does not change, nor does the TCSESSIONID cookie value change either. I have restarted the server and am performing most attempts in an incognito window with no luck.

Is there anything that I'm missing?

SteppingHat commented 5 years ago

Solved the issue. I was simply using the wrong endpoint. It seems that the OAuth 2.0 endpoint does not work.

Doesn't work

https://login.microsoftonline.com/<tenantId>/oauth2/v2.0/authorize

Does work

https://login.microsoftonline.com/<tenantId>/oauth2/authorize

The help text underneath the Endpoint URL field reads Azure OAuth 2.0 authorization endpoint URL. It might be a good idea to update this to be clearer.

johndietz commented 5 years ago

Thanks so much for the follow up @SteppingHat - i was getting bit by the exact same issue, removing the v2.0 from the route fixed me right up. Appreciate your secondary note a bunch.

Mistuke commented 4 years ago

Thanks @SteppingHat that helped me too!

burnasheva commented 4 years ago

I've created a bug in our YouTrack. We'll support v2 URLs. Please, watch\vote it to get future updates.

DanielBryars commented 4 years ago

@SteppingHat Thank you! I had the same issue. Sorted now.