Home › Entra ID › AADSTS50105

Entra ID · AADSTS50105 · Entra ID / Azure AD

AADSTS50105: Entra ID User Not Assigned to Role for App

User is blocked from accessing an Azure AD application due to lack of role assignment; assign user or disable requirement.

Error Details

FactValueSourceNote
Exact error stringAADSTS50105: The signed-in user is not assigned to a role for the application '<app-id>'Entra admin center sign-in logs->
User assignment required settingYesEnterprise applications > <app> > Properties->
Registry key involvedHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AzureADWindows Registry->
Relevant service/endpoint URLhttps://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/tokenAPI Endpoint->
Log line signatureAADSTS50105: The signed-in user is not assigned to a role for the application '<app-id>'Entra admin center sign-in logs->

Log Files to Check

What This Error Actually Means

The error code AADSTS50105 signifies that a user attempting to sign into an Azure AD application is missing the necessary role assignment required for access. This restriction is enforced by Entra ID, which checks if the signed-in user has been explicitly assigned to use the specified application or belongs to a group that has been granted permission. The error message "AADSTS50105: The signed-in user is not assigned to a role for the application ''" appears in the sign-in logs of Entra ID, indicating that the user lacks the necessary permissions to access the specified enterprise application.

Affected Versions and Scope

This error affects all versions of Azure AD and Entra ID where User Assignment is required for an application. The setting "User assignment required" must be enabled in the Enterprise Application settings within Entra ID, which restricts sign-in to only those users who have been explicitly assigned roles or groups with access rights. This configuration does not apply to applications that do not enforce user assignments; hence, if this error is encountered on an application without such a requirement, it would indicate either misconfiguration or a different issue altogether.

Where To Look First: Logs and Event IDs

To diagnose AADSTS50105 errors, start by examining the sign-in logs in Entra ID. These logs are located at C:\ProgramData\Microsoft\IdentityManager\Logs\idaudit.log. The exact log line to grep for is "AADSTS50105: The signed-in user is not assigned to a role for the application ''". Additionally, review the web server logs stored in C:\inetpub\logs\LogFiles\W3SVC1 for any related entries. Event IDs 4726 and 4728 can also provide useful context regarding user authentication attempts and failures.

Root Causes

User Not Assigned to the Application or Group

When a user is not assigned directly to an application or does not belong to any group that has been granted access, they will encounter AADSTS50105. This can be identified by checking if the user appears in the list of users and groups associated with the application.

Role Assignment Removed During Offboarding

If a user's role assignment was inadvertently removed during an offboarding process but not restored, they will face this error when trying to access the application. Reviewing the history of changes within Entra ID can help identify such cases.

SAML SSO App with Incorrect Claim Mapping

For applications using SAML Single Sign-On (SSO), users must be part of a specific claim-mapping group defined in the IdP configuration. If this mapping is incorrect or missing, users will receive AADSTS50105.

Fix Procedure

  1. Check User Assignment: Navigate to Entra admin center > Applications > Enterprise applications > > Users and groups — verify the user appears in the list.
  2. Verify Assignment Requirement: Go to Entra admin center > Applications > Enterprise applications > > Properties — confirm 'Assignment required?' is set to Yes.
  3. In PowerShell, Check Assignment: Run (Get-AzureADServiceAppRoleAssignment -ObjectId (Get-AzureADServicePrincipal -Filter "DisplayName eq ''").ObjectId | Where-Object PrincipalDisplayName -eq '').Id.
  4. Check for Group-Based Assignment: Execute Get-AzureADGroupMember -ObjectId | Where-Object DisplayName -eq ''.
  5. Review Conditional Access Policy: Check Entra admin center > Protection > Conditional Access — filter by the application to see if a policy is excluding the user.
  6. Assign User or Group to Application: In Entra admin center, go to Applications > Enterprise applications > > Users and groups > Add user/group — select the user and app role (Default Access).
  7. Assign via PowerShell: Use New-AzureADUserAppRoleAssignment -ObjectId -PrincipalId -ResourceId -Id (Get-AzureADServiceAppRoleAssignment -ObjectId | Select-Object -First 1).Id.
  8. Bulk Assignment: Assign a group instead: Entra admin center > Applications > Enterprise applications > > Users and groups > Add user/group > select a security group.
  9. Disable Assignment Requirement (if appropriate): Navigate to Entra admin center > Applications > Enterprise applications > > Properties > Assignment required? = No — all users in the tenant can sign in.
  10. Disabling user assignment requirements may expose your application to unauthorized access. Ensure this is a necessary step for your security policy.

Error Code Variants

Code Description Distinguishing Factors
AADSTS50104 User is not a member of the required group. This error occurs when a user needs to be part of a specific security group for access, but they are missing that membership.
AADSTS50126 Invalid username or password. Different from AADSTS50105 as it indicates authentication failure rather than authorization issues.

Verification

After applying the fix, verify that the user can now access the application without encountering AADSTS50105. Check the sign-in logs for successful entries and ensure there are no further errors in C:\ProgramData\Microsoft\IdentityManager\Logs\idaudit.log. Additionally, confirm that the 'Assignment required?' setting is correctly configured for the application.

Prevention

To prevent recurrence of AADSTS50105, ensure proper management and documentation of user assignments and group memberships. Implement automated scripts or policies to maintain role assignments during onboarding and offboarding processes. Regularly review and update conditional access policies to align with current security requirements.
Use Get-WinEvent -LogName "Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin" -MaxEvents 50 for quick diagnostics of recent authentication attempts.
This guide provides a comprehensive approach to diagnosing and resolving AADSTS50105 errors in Entra ID, ensuring that users have the necessary permissions to access enterprise applications securely.

Sources & References

Related Guides

Get new error code fixes by email

Product-specific solutions for Intune, Autopilot, SCCM and Entra ID — straight to your inbox. No spam.