How to restrict user login limited to specific domain. (for ex: microsoft.com)

Jyoti Tumsare 1 Reputation point
2020-06-17T14:15:19.663+00:00

Hi,

I want to restrict user must login only with .microsoft.com domain name.

He /She should not log in with another domain name.

Is there any API/SDK for the same.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. AmanpreetSingh-MSFT 56,871 Reputation points Moderator
    2020-06-17T14:24:49.897+00:00

    Hello @JyotiTumsare-6484

    For this purpose, you need to configure tenant restriction via your proxy device. You need to configure your proxy device to inject Restrict-Access-To-Tenants: <permitted tenant list> to the header of your data and Azure AD will only issue tokens for the tenants in the permitted tenants list. You can test this solution using Fiddler tool as well. Please find below the document for more details:

    https://learn.microsoft.com/en-us/azure/active-directory/manage-apps/tenant-restrictions


    Please do not forget to "Accept the answer" wherever the information provided helps you. This will help others in the community as well.

    0 comments No comments

  2. Rohit Gavfale 16 Reputation points
    2020-06-18T11:47:22.063+00:00

    Hello @ I have used the NodeJS Quickstart Application for the Single Sign on. 10373-nodejs.png

    This redirect me to Microsoft login

    10323-microsoft-login.png This allow me to login with every domain for ex. click2cloud.net and may more but, I just want to login with only @microsoft.com domain.

    How can I restrict for the specific domain? Please help us for the same.

    I follow below docs , is it helpful?

    10324-specific-domain.png


  3. Santhosh kumar 1 Reputation point
    2021-09-17T07:33:29.113+00:00

    @AmanpreetSingh-MSFT The Restrict-Access-To-Tenants header is not working as expected. I am using fiddler to test the behaviour and its allowing me to enter user with other domain name other than the ones specified in Restrict-Access-To-Tenants header.

    Can you please help on the same?

    0 comments No comments

  4. Santhosh kumar 1 Reputation point
    2021-09-17T07:35:57.767+00:00

    @AmanpreetSingh-MSFT I am using my Organization Azure AD for Multi tenant Microsoft Login and created a multi-tenant app registration for the same. The requirement is to allow users from only few domains to login. Like I mentioned in the above comment, its not working as expected.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.