Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The token request should not include the scope parameter #130

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ReactNode } from 'react'

interface TTokenRqBase {
grant_type: string
scope?: string
client_id: string
redirect_uri: string
}
Expand All @@ -13,6 +12,7 @@ export interface TTokenRequestWithCodeAndVerifier extends TTokenRqBase {
}

export interface TTokenRequestForRefresh extends TTokenRqBase {
scope?: string
refresh_token: string
}

Expand Down
1 change: 0 additions & 1 deletion src/authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export const fetchTokens = (config: TInternalConfig): Promise<TTokenResponse> =>
const tokenRequest: TTokenRequestWithCodeAndVerifier = {
anthony-vito marked this conversation as resolved.
Show resolved Hide resolved
grant_type: 'authorization_code',
code: authCode,
scope: config.scope,
client_id: config.clientId,
redirect_uri: config.redirectUri,
code_verifier: codeVerifier,
Expand Down
2 changes: 1 addition & 1 deletion tests/get_token.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test('make token request with extra parameters', async () => {

await waitFor(() =>
expect(fetch).toHaveBeenCalledWith('myTokenEndpoint', {
body: 'grant_type=authorization_code&code=1234&scope=someScope%20openid&client_id=anotherClientId&redirect_uri=http%3A%2F%2Flocalhost%2F&code_verifier=arandomstring&testTokenKey=tokenValue',
body: 'grant_type=authorization_code&code=1234&client_id=anotherClientId&redirect_uri=http%3A%2F%2Flocalhost%2F&code_verifier=arandomstring&testTokenKey=tokenValue',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
Expand Down