Hello @Ben in CA ,
Thank you for posting your query on Microsoft Q&A.
From your description, it seems you're facing an issue where, even with "Assignment Required" set to "Yes" in the Entra Admin Center, you're still able to log in with an unassigned Microsoft account. Despite setting "Enabled for users to sign-in" to "No" and clearing the cache, the authentication flow isn't respecting your settings. You're using msal-react with useIsAuthenticated()
for managing authentication.
Even if you set "Enabled for users to sign-in" to No, you still need to ensure that "Assignment Required" is set to Yes. This is the key to restricting access to only those users who are explicitly assigned to your application.
Steps to do that :
- In the Microsoft Entra Admin Center, ensure "Enabled for users to sign-in" is set to Yes. This is required to allow the application to be used.
- Ensure "Assignment Required" is set to Yes. This will restrict access to only the users explicitly assigned to your app.
By doing this, only the assigned users will be able to sign in. You can assign users through the "Enterprise Applications" section in Entra ID.
Let me know if this helps or if you need further clarification.
I hope this information is helpful. Please feel free to reach out if you have any further questions. If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Thanks,
Chaithra.