Skip to content

Commit

Permalink
Addressed 1P failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
shylasummers committed Jul 20, 2023
1 parent a8c9663 commit f60400f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/msal-browser/src/config/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
Constants,
ProtocolMode,
OIDCOptions,
CompareOIDCOptions,
ServerResponseType,
LogLevel,
StubbedNetworkModule,
Expand Down Expand Up @@ -327,7 +328,8 @@ export function buildConfiguration(

// Throw an error if user has set OIDCOptions without being in OIDC protocol mode
if(userInputAuth?.protocolMode !== ProtocolMode.OIDC &&
userInputAuth?.OIDCOptions) {
userInputAuth?.OIDCOptions &&
!CompareOIDCOptions(userInputAuth.OIDCOptions, DEFAULT_AUTH_OPTIONS.OIDCOptions)) {
throw ClientConfigurationError.createCannotSetOIDCOptionsError();
}

Expand All @@ -337,7 +339,7 @@ export function buildConfiguration(
providedSystemOptions?.allowNativeBroker) {
throw ClientConfigurationError.createCannotAllowNativeBrokerError();
}

const overlayedConfig: BrowserConfiguration = {
auth: {
...DEFAULT_AUTH_OPTIONS,
Expand Down
5 changes: 5 additions & 0 deletions lib/msal-common/src/authority/OIDCOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ export type OIDCOptions = {
serverResponseType?: ServerResponseType;
defaultScopes?: Array<string>;
};

export function CompareOIDCOptions(first: OIDCOptions, second: OIDCOptions): boolean {
return (first.serverResponseType === second.serverResponseType &&
first.defaultScopes === second.defaultScopes);
};
2 changes: 1 addition & 1 deletion lib/msal-common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export {
export { AuthorityFactory } from "./authority/AuthorityFactory";
export { AuthorityType } from "./authority/AuthorityType";
export { ProtocolMode } from "./authority/ProtocolMode";
export { OIDCOptions } from "./authority/OIDCOptions";
export { OIDCOptions, CompareOIDCOptions } from "./authority/OIDCOptions";
// Broker
export { INativeBrokerPlugin } from "./broker/nativeBroker/INativeBrokerPlugin";
// Cache
Expand Down

0 comments on commit f60400f

Please sign in to comment.