markbates / goth

Package goth provides a simple, clean, and idiomatic way to write authentication packages for Go web applications.
https://blog.gobuffalo.io/goth-needs-a-new-maintainer-626cd47ca37b
MIT License
5.2k stars 566 forks source link

microsoftonline appears broken #559

Closed jamesbalcombe83 closed 4 weeks ago

jamesbalcombe83 commented 1 month ago

The microsoftonline provider appears to be broken. I tried to set this up using Entra in the Azure developer console, but when attempting login after setting up an app I call callback error like this

error: oauth2: "invalid_request" "AADSTS900144: The request body must contain the following parameter: 'code'. Trace ID: ba5c11d9-2dd8-4b1f-94ac-657adc0f6900 Correlation ID: 9ed45c68-72b0-431f-a4b6-ce9c1ba9088c Timestamp: 2024-05-22 05:26:09Z" "https://login.microsoftonline.com/error?code=900144"

I followed the example in this repo, and provided all the relevant ids and secrets.

tboerger commented 4 weeks ago

If you try to set up EntraID, ex Azure AD, you got to use azureadv2 provider and not the deprecated microsoftonline integration.

jamesbalcombe83 commented 4 weeks ago

If you try to set up EntraID, ex Azure AD, you got to use azureadv2 provider and not the deprecated microsoftonline integration.

Oh this makes a lot of sense, I didn't even think to look for Azure in the provider list. The microsoftonline provider should probably be removed, since I assume there is no longer any way to use it at all?

jamesbalcombe83 commented 4 weeks ago

Using azureadv2 and setting up EntraID to use any kind of microsoft account worked.