Search code examples
cordovaadal

Ms ADAL login whith the same token apps Ionic 4


I'm trying microsoft adal login in two apps whith same client id and tenant in ionic 4. But when i login whith Office 365 in the first app, the second ask also to login. Example with microsoft sharepoint, if you connect, you do not need to reconnect to use teams or another service.

How do I get my two apps to use the same token ?

Thank you in advance !


Solution

  • Microsoft ADAL Login behaves as oauth provider. It will help the user not to enter the credentials again but for different applications, you will need to press login in all applications in order to fetch token. Take the example of Google Oauth login, I can login in stackoverflow using google auth and I can login into serverfault using google auth. Logging into one will not automatically login into another one (but while trying to second website, I don't have to enter google credentials provided I am still logged into google).

    Microsoft ADAL behaves exactly as Google Oauth. In case of microsoft team, since the products and oauth provider are from same company, they have optimized not to ask permission and hence you see briefly they redirect you to sso page and them immediately user is logs into website (this happens for first time, subsequent time token refresh happens and hence redirect is not visible).

    Hope this answers your question.