Omniauth Azure does not ask for MFA only when using Gitlab

This is a weird issue so I’m just hoping someone else has had the same issue and will see this post.

Connected my Gitlab to Azure with omniauth, it works, but when I login I get an error and I have to open a new tab, go to outlook.com for example, it immediately asks for MFA, I enter the code. Then I go back to the gitlab tab and try to login with Azure again, and now I’m logged in.

One other friend tried this and he’s saying that it works fine for me, he gets MFA from gitlab and logs in.

This is the error;


Could not authenticate you from AzureOauth2 because "Interaction required: aadsts50076: due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '00000002-0000-0000-c000-000000000000'. trace id: 14d9dab7-5c4f-4250-b4b9-ab7db5270000 correlation id: 577b2c50-9e46-458c-bef8-99995e3c0cff timestamp: 2024-04-29 06:25:14z {"error":"interaction required","error description":"aadsts50076: due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '00000002-0000-0000-c000-000000000000'. trace id: 14d9dab7-5c4f-4250-b4b9-ab7db5270000 correlation id: 577b2c50-9e46-458c-bef8-99995e3c0cff timestamp: 2024-04-29 06:25:14z","error codes":[50076],"timestamp":"2024-04-29 06:25:14z","trace id":"14d9dab7-5c4f-4250-b4b9-ab7db5270000","correlation id":"577b2c50-9e46-458c-bef8-99995e3c0cff","error uri":"https://login.microsoftonline.com/error?code=50076","suberror":"basic action","claims":"{\"access token\":{\"capolids\":{\"essential\":true,\"values\":[\"c662bd2f-21ab-4ce1-8dc2-f5e20b56ae1e\"]}}}"}".

Googling it seems to be related to policy in azure. But I was hoping someone here had more info.