Skip to content

Commit

Permalink
Add metadata parameter to AuthContext (#997)
Browse files Browse the repository at this point in the history
Co-authored-by: adam <innes@50000feet.com>
  • Loading branch information
hwo-wd and 50k-Adam committed Apr 21, 2023
1 parent 8462027 commit 1e6703b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/AuthContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const initUserManager = (props: AuthProviderProps): UserManager => {
popupRedirectUri,
popupWindowTarget,
extraQueryParams,
metadata,
} = props;
return new UserManager({
authority: authority || '',
Expand All @@ -81,6 +82,7 @@ export const initUserManager = (props: AuthProviderProps): UserManager => {
popupWindowTarget: popupWindowTarget,
automaticSilentRenew,
extraQueryParams,
metadata: metadata,
});
};

Expand Down
5 changes: 5 additions & 0 deletions src/AuthContextInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
PopupWindowFeatures,
SigninRedirectArgs,
SignoutRedirectArgs,
OidcMetadata,
} from 'oidc-client-ts';
export interface Location {
search: string;
Expand Down Expand Up @@ -38,6 +39,10 @@ export interface AuthProviderProps {
* The URL of the OIDC/OAuth2 provider.
*/
authority?: string;
/**
* Manually set metadata if CORS is not configured on the OIDC/OAuth2 provider.
*/
metadata?: Partial<OidcMetadata>;
/**
* Extra query params passed to the authorization url.
*/
Expand Down

0 comments on commit 1e6703b

Please sign in to comment.