Resolves #41. Add support for code_challenge param

This commit is contained in:
ErickSkrauch 2025-01-15 14:33:55 +01:00
parent fdef4a33bf
commit beb3927f78
No known key found for this signature in database
GPG Key ID: 669339FCBB30EE0E
3 changed files with 8 additions and 0 deletions

View File

@ -44,6 +44,8 @@ export interface OauthAuthCodeFlowParams {
responseType: string;
state: string;
scope: string;
code_challenge?: string;
code_challenge_method?: string;
}
export interface OauthDeviceCodeFlowParams {

View File

@ -30,6 +30,8 @@ describe('OAuthState', () => {
response_type: 'response_type',
description: 'description',
scope: 'scope1 scope2',
code_challenge: 'code_challenge',
code_challenge_method: 'S256',
prompt: 'none',
login_hint: '1',
state: 'state',
@ -50,6 +52,8 @@ describe('OAuthState', () => {
responseType: query.response_type,
scope: query.scope,
state: query.state,
code_challenge: query.code_challenge,
code_challenge_method: query.code_challenge_method,
},
description: query.description,
prompt: query.prompt,

View File

@ -14,6 +14,8 @@ export default class InitOAuthAuthCodeFlowState extends AbstractState {
responseType: query.get('response_type')!,
scope: (query.get('scope') || '').replace(/,/g, ' '),
state: query.get('state')!,
code_challenge: query.get('code_challenge') || undefined,
code_challenge_method: query.get('code_challenge_method') || undefined,
},
description: query.get('description')!,
prompt: query.get('prompt')!,