Balaraju Polaki
Balaraju Polaki

Reputation: 133

How to implement Azure multi tenant app access in angular 2

I'm new to angular 2 . I am working on Multi Tenant application in angular 2. I have done Multi Tenant application in ASP.netMVC.But in angular2 i'm not getting any idea.

I have done single tenant authentication in Angular 2 by following this article

any anser appriciated.

Thanks in Advance....!

Upvotes: 1

Views: 1290

Answers (2)

Balaraju Polaki
Balaraju Polaki

Reputation: 133

I'm able to access multi tenant app in Angular 2. by tenant value as common

Thanks Nan

    public AdalConfig(): any {
    return {
        tenant: 'common',
        clientId: 'xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx',
        redirectUri: window.location.origin + '/',
        postLogoutRediFFFFrectUri: window.location.origin + '/'
    };

}

Upvotes: 1

Nan Yu
Nan Yu

Reputation: 27538

Firstly ,you can make your registration multi-tenant by finding the "Multi-Tenanted" switch on the properties page of your application registration in the Azure portal and setting it to "Yes".

Then please update your code to send requests to /common .With a multi-tenant application, the application doesn’t know up front what tenant the user is from, so you can’t send requests to a tenant’s endpoint. Instead, requests are sent to an endpoint that multiplexes across all Azure AD tenants:

https://login.microsoftonline.com/common

In your code , try to replace tenant value to common . Please click here for more details about how to sign in any Azure Active Directory (AD) user using the multi-tenant application pattern .

Upvotes: 2

Related Questions