Forum Discussion
Authentication and authorization with Entra ID
My rails app (using the microsoft_office365 gem) allows users to login/register with their MS account/email. Registered and configured an application at Entra admin center. The problem occurs when users try to consent the app. They are redirected to the MS consent page, but when redirected back to my website it gives an error.
The authorization process makes 2 requests:
Sending: POST http://login.microsoftonline.com:443/common/oauth2/v2.0/token
Status: 200
Response: access_token/refresh_token data
Sending: GET http://graph.microsoft.com:443/v1.0/me
Status: 401
Response: {"error":{"code":"UnknownError","message":"","innerError":{"date":"2024-04-05T14:18:43","request-id":"...","client-request-id":"..."}}}
omniauth: (microsoft_office365) Authentication failure! invalid_credentials: OAuth2::Error
If i try to authorize/consent with the same email the app was registered in Entra Admin, it works.
Could it be that the entra app is not configured property or its because the app is not verified. I can see a message in the Entra Admin center:
"Starting November 9th, 2020 end users will no longer be able to grant consent to newly registered multitenant apps without verified publishers"