I’m having difficulty using OAuth2 and Microsoft’s authorization server to get an access token with a set of permissions for a user that can be used to retrieve information from the OneDrive app via Microsoft Graph.
I GET
the Microsoft OAuth endpoint (login.microsoftonline.com/common/oauth2/v2.0/authorize
) with redirect_uri
of my secured ASP.NET endpoint. The response_type
is code id_token
and the respones_mode
is form_post
.
After completing the authorization process, I get redirected to my ASP.NET endpoint with id_token
, code
, and state
. The browser however is not including the ASP.NET_SessionId
cookie in the request due to its SameSite
attribute being set to Lax
. If I set the SameSite
cookie attribute to None
, the endpoint can be reached, but this is not a secure solution and only endpoints with [AllowAnonymous]
attributes can be reached.
The Initiator
of the last call is oauth20_authorize.srf
, which is different from other websites that typically use document
. I’m not sure if this is the right track.
Is there a secure workaround solution to this issue?