A cloud-based identity and access management service for securing user authentication and resource access
Are the allowed users Global Admins? The assignment restrictions dont apply to them
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I have an application integrated with Microsoft Entra ID using OIDC through oauth2-proxy.
The Enterprise Application has:
Assignment required? = Yes
My expectation is that only users or groups explicitly assigned under:
Enterprise applications → <application> → Users and groups
should be able to authenticate. However, users who are not assigned to the Enterprise Application are still able to complete the OIDC login successfully.
The flow is:
User → Microsoft Entra ID → successful authentication → redirect to /oauth2/callback → oauth2-proxy creates a valid session
The sign-in log in Entra shows the login as successful. I was expecting Entra to block the user before the callback, with an error such as: AADSTS50105 - The signed in user is not assigned to a role for the application
Relevant sanitized configuration:
OAUTH2_PROXY_PROVIDER=oidc
OAUTH2_PROXY_OIDC_ISSUER_URL=https://login.microsoftonline.com/<tenant-id>/v2.0
OAUTH2_PROXY_REDIRECT_URL=https://<app-domain>/oauth2/callback
OAUTH2_PROXY_OIDC_EMAIL_CLAIM=preferred_username
OAUTH2_PROXY_SCOPE=openid profile email
The proxy is also configured to allow specific email domains, but no per-user allowlist is configured. The user is authenticated successfully even after being removed from the Enterprise Application assignment list.
Things already checked:
Question:
Should “Assignment required = Yes” block unassigned users in this OIDC flow before tokens are issued?
If yes, what additional configuration is required to make Entra enforce assignment for this type of OIDC application?
Any guidance would be appreciated.
A cloud-based identity and access management service for securing user authentication and resource access
Are the allowed users Global Admins? The assignment restrictions dont apply to them
AI answer
Yes. When Assignment required is set to Yes on an enterprise application that uses OpenID Connect, Microsoft Entra ID must block unassigned users from obtaining tokens for that application and return an error like AADSTS50105. No additional “special” configuration is required beyond correctly targeting the right enterprise application and having Assignment required enabled on that service principal.
From the documented behavior of the Assignment required setting:
Given that unassigned users are still getting tokens, the behavior indicates that at least one of the following is true in the actual configuration:
To have Entra enforce assignment for this OIDC flow:
When these conditions are met, Entra ID should deny token issuance to unassigned users and return an error such as AADSTS50105, preventing oauth2-proxy from establishing a session.
References: