You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
Expect browser window to open, select user and be redirected to the Go app. Then expect the code exchange to work and be authenticated.
Actual behavior
The code exchange does not work. I get the following error here:
Which version of MSAL Go are you using?
Note that to get help, you need to run the latest version.
1.2.0
Where is the issue?
Is this a new or an existing app?
This is a new app or an experiment.
What version of Go are you using (
go version
)?Go vers
What operating system and processor architecture are you using (
go env
)?go env
OutputRepro
func AzureADAuthMiddleware() gin.HandlerFunc { return func(c *gin.Context) { client, err := public.New("", public.WithAuthority("https://login.microsoftonline.com/")) result, err := client.AcquireTokenInteractive(context.TODO(), []string{"openid"}, public.WithRedirectURI("http://localhost:8082")) if err != nil { c.String(http.StatusUnauthorized, "Unauthorized") c.Abort() return } c.Set("account", result) c.Next() }
}
Expected behavior
Expect browser window to open, select user and be redirected to the Go app. Then expect the code exchange to work and be authenticated.
Actual behavior
The code exchange does not work. I get the following error here:
microsoft-authentication-library-for-go/apps/public/public.go
Line 677 in c3591af
AADSTS9002327: Tokens issued for the 'Single-Page Application' client-type may only be redeemed via cross-origin requests.
Possible solution
Based on searching around I tried adding a "Origin": "localhost:8082" in the addStdHeaders() function here:
microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go
Line 319 in c3591af
The text was updated successfully, but these errors were encountered: