Closed ay13 closed 1 week ago
Hi @ay13 ! I ran into this issue as well, my specific cause was that I was not setting the issuer url correctly.
Assuming that you're trying to use a Microsoft 365 business plan for this, please try to verify that your issuer variable is set to https://login.microsoftonline.com/{tenantId}/v2.0
, you can reference the docs here https://learn.microsoft.com/en-us/entra/identity-platform/v2-protocols-oidc#find-your-apps-openid-configuration-document-uri.
Hopefully that helps.
Thanks for the reply @diego-gt , I verified that my issuer is set up the correct way. Same issue.
Disregard this issue, it was my mistake.
In the redirect section of Entra ID I set my redirect as a Single-page app, when I set it as a web app it worked correctly.
Hi @ay13 I've also been racking my brain on this for 3 days. Is this the proposed fix, setting the redirect as a web app? Does everything work as expected?
Thanks!
@warrantor For me, setting the platform to Web
worked and Single-page application
did not. I believe Entra returns the token differntly based on which of those you select.
How my Authentication settings look now.
Glad you got it working! Yes, the redirect should be set as a Web app instead of SPA, the Entra platform will provide different tokens (Access Tokens for SPAs vs ID Tokens for Web app) depending on that type. It doesn't limit you to use only server components, it works on both. The way you access the session is different though. Docs for app types: https://learn.microsoft.com/en-us/entra/identity-platform/v2-app-types
Provider type
This is using Entra ID provider. Entra wasnt an option in the drop down so I chose AD Azure Active Directory
Environment
Reproduction URL
https://github.com/ay13/auth-entra
Describe the issue
After the initial auth process it redirects back to the app and displays the message:
in the console I see the error:
How to reproduce
npx sv create
Expected behavior
I expected to authenticate without an error