Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/AuthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface AuthServiceProps {
provider: string
authorizeEndpoint?: string
tokenEndpoint?: string
audience?: string
redirectUri?: string
scopes: string[]
autoRefresh?: boolean
Expand Down Expand Up @@ -158,7 +159,7 @@ export class AuthService<TIDToken = JWTIDToken> {

// this will do a full page reload and to to the OAuth2 provider's login page and then redirect back to redirectUri
authorize(): boolean {
const { clientId, provider, authorizeEndpoint, redirectUri, scopes } = this.props
const { clientId, provider, authorizeEndpoint, redirectUri, scopes, audience } = this.props

const pkce = createPKCECodes()
window.localStorage.setItem('pkce', JSON.stringify(pkce))
Expand All @@ -171,6 +172,7 @@ export class AuthService<TIDToken = JWTIDToken> {
scope: scopes.join(' '),
responseType: 'code',
redirectUri,
...(audience && { audience }),
codeChallenge,
codeChallengeMethod: 'S256'
}
Expand Down