OfficeDev / office-js-helpers

[ARCHIVED] A collection of helpers to simplify development of Office Add-ins & Microsoft Teams Tabs
MIT License
126 stars 56 forks source link

Azure AD B2C - presenting wrong login page. #61

Open MichalKoscielniak opened 6 years ago

MichalKoscielniak commented 6 years ago

Is it possible to use it for Azure Active Directory B2C ? When i try to use the library with following code:

this.authenticator = new OfficeHelpers.Authenticator();
this.authenticator.endpoints.registerAzureADAuth('myClientId', 'myTenant');
...
this.authenticator.authenticate(OfficeHelpers.DefaultEndpoints.AzureAD)

It's opening the "general" microsoft login page instead of my tenant's login page.

WrathOfZombies commented 6 years ago

Weird.. I am not sure about this. Let me get back to you. We add the tenant Id in the url and that should focus the auth only to the specific B2C directory.

WrathOfZombies commented 6 years ago

@MichalKoscielniak Sorry for the late response, I wasn't able to get much info on this. Not sure if we are making the wrong call.

MichalKoscielniak commented 6 years ago

@WrathOfZombies In the end we have wrote our own AAD B2C integration. But in order to make yours work we had to "add" two parameters to url constructed by your library: 1) domainHint=mydomain.com 2) don't remember the name but it was 2 characters long and contained x ( dx or something like that )

Regards, Michal