sureshchahal / angular2-adal

Angular 2 wrapper for adal.js
MIT License
41 stars 50 forks source link

Angular2-adal WS-Federation Authentication #82

Open smille69 opened 6 years ago

smille69 commented 6 years ago

Is there an implementation of this library where you specify the domain and be taken directly to the Azure WS-Federation login page without having to enter your email address one page, then redirected to the Ws-Federation page to enter your password? Currently, if I see that if you Azure setup is using Ws-Federation, you get 2 login pages instead of just one. I would appreciate any help on this to be able to use WsFederation authentication. Has anyone done this before?

wvanderdeijl commented 6 years ago

we achieve this by adding a domain_hint query parameter to the ADAL request. You can do this by adding this to your ADAL config object:

        const config: adal.Config = {
            tenant: 'supersecret.onmicrosoft.com',
            clientId: 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
            extraQueryParameter: 'domain_hint=example.com'
        };

I don't understand why this is not better documented in the Azure docs, but I found this tip at http://www.cloudidentity.com/blog/2014/11/17/skipping-the-home-realm-discovery-page-in-azure-ad/

smille69 commented 6 years ago

OMG! That is what I needed!! You guys are the bomb!! You have an awesome library!!
Thanks a million!! Its works! This is resolved and can be closed out. Thanks again!!

wvanderdeijl commented 6 years ago

It's actually not my library. I just stumbled upon your issue and happened to have figured this out a couple of weeks ago for my current project. Good luck.