Skip to content

Commit eee45bf

Browse files
fixed bug where msal options are not passed to msal in the teams provider (#497)
Co-authored-by: Shane Weaver <[email protected]>
1 parent 400e5e9 commit eee45bf

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

src/providers/TeamsProvider.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ interface AuthParams {
5050
* @memberof AuthParams
5151
*/
5252
loginHint?: string;
53+
54+
/**
55+
* Additional Msal configurations options to use
56+
* See Msal.js documentation for more details
57+
*
58+
* @type {Configuration}
59+
* @memberof TeamsConfig
60+
*/
61+
options?: Configuration;
5362
}
5463

5564
/**
@@ -167,16 +176,14 @@ export class TeamsProvider extends MsalProvider {
167176

168177
const scopes = authParams.scopes ? authParams.scopes.split(',') : null;
169178

179+
const options = authParams.options || { auth: { clientId: authParams.clientId } };
180+
181+
options.system = options.system || {};
182+
options.system.loadFrameTimeout = 10000;
183+
170184
const provider = new MsalProvider({
171185
clientId: authParams.clientId,
172-
options: {
173-
auth: {
174-
clientId: authParams.clientId
175-
},
176-
system: {
177-
loadFrameTimeout: 10000
178-
}
179-
},
186+
options,
180187
scopes
181188
});
182189

@@ -228,6 +235,7 @@ export class TeamsProvider extends MsalProvider {
228235

229236
private teamsContext;
230237
private _authPopupUrl: string;
238+
private _msalOptions: Configuration;
231239

232240
constructor(config: TeamsConfig) {
233241
super({
@@ -237,6 +245,7 @@ export class TeamsProvider extends MsalProvider {
237245
scopes: config.scopes
238246
});
239247

248+
this._msalOptions = config.msalOptions;
240249
this._authPopupUrl = config.authPopupUrl;
241250

242251
const teams = TeamsHelper.microsoftTeamsLib;
@@ -260,6 +269,7 @@ export class TeamsProvider extends MsalProvider {
260269
const authParams: AuthParams = {
261270
clientId: this.clientId,
262271
loginHint: context.loginHint,
272+
options: this._msalOptions,
263273
scopes: this.scopes.join(',')
264274
};
265275

0 commit comments

Comments
 (0)