benbaran / msal-angular

Angular MSAL Wrapper Module
MIT License
16 stars 16 forks source link

allow for authority to be specified in config #7

Open zymplsi opened 6 years ago

zymplsi commented 6 years ago

Hi, Can you edit the module to allow authentication in a single tenant scenario. I figured the 'authority' value need to be introduced in the config.

//environment.ts
export const environment = {
  production: false,
  clientID: 'xxxxxxxx-xxxx-xxxx-xxxx-e01a58b165c5',
  graphScopes: ['User.Read', 'User.ReadBasic.All'],
  authority: 'https://login.microsoftonline.com/<tenant>.onmicrosoft.com'
};
// msal-angular
// msal.service.js
export class MsalService 
{
,,,
const authority = ( !config.authority && config.tenant && config.signUpSignInPolicy) ?
            `https://login.microsoftonline.com/tfp/${config.tenant}/${config.signUpSignInPolicy}` : config.authority;
,,,
}