alexandrtovmach / react-microsoft-login

Microsoft services authorization with React.
https://alexandrtovmach.github.io/react-microsoft-login
MIT License
80 stars 38 forks source link

Can't send Tenant prop #9

Closed SogenOvitch closed 5 years ago

SogenOvitch commented 5 years ago

Hi,

I was just wondering about how hard would it be for you to add the Tenant property into the button ? so that the authority called by msal would not be : https://login.microsoftonline.com/common but might be https://login.microsoftonline.com/<tenant || "common"> In fact it's usefull when you wanna bring restriction about the email domain of people that can use your app.

Could you add it ?

Best regards & good job

alexandrtovmach commented 5 years ago

@SogenHommeTeh Thanks for the idea, I'll take a look.

alexandrtovmach commented 5 years ago

Hello,

Added tenantUrl property in v1.2.0. Example:

<MicrosoftLogin
        clientId={YOUR_CLIENT_ID}
        tenantUrl={YOUR_TENANT_URL}
        authCallback={authHandler}
/>

How to build the URL read here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics