Skip to content

Commit

Permalink
fix: authts#1175 allow to optionally pass redirect_uri into exchangeR…
Browse files Browse the repository at this point in the history
…efreshToken
  • Loading branch information
pamapa authored and Chris Keogh committed Apr 3, 2024
1 parent 801dfa0 commit 4ac6dda
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/oidc-client-ts.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export class OidcClient {
// (undocumented)
protected readonly _tokenClient: TokenClient;
// (undocumented)
useRefreshToken({ state, resource, timeoutInSeconds, extraTokenParams, }: UseRefreshTokenArgs): Promise<SigninResponse>;
useRefreshToken({ state, redirect_uri, resource, timeoutInSeconds, extraTokenParams, }: UseRefreshTokenArgs): Promise<SigninResponse>;
// Warning: (ae-forgotten-export) The symbol "ResponseValidator" needs to be exported by the entry point index.d.ts
//
// (undocumented)
Expand Down Expand Up @@ -927,6 +927,8 @@ export interface UseRefreshTokenArgs {
// (undocumented)
extraTokenParams?: Record<string, unknown>;
// (undocumented)
redirect_uri?: string;
// (undocumented)
resource?: string | string[];
// (undocumented)
state: RefreshState;
Expand Down
3 changes: 3 additions & 0 deletions src/OidcClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface CreateSigninRequestArgs
* @public
*/
export interface UseRefreshTokenArgs {
redirect_uri?: string;
resource?: string | string[];
extraTokenParams?: Record<string, unknown>;
timeoutInSeconds?: number;
Expand Down Expand Up @@ -187,6 +188,7 @@ export class OidcClient {

public async useRefreshToken({
state,
redirect_uri,
resource,
timeoutInSeconds,
extraTokenParams,
Expand All @@ -210,6 +212,7 @@ export class OidcClient {
refresh_token: state.refresh_token,
// provide the (possible filtered) scope list
scope,
redirect_uri,
resource,
timeoutInSeconds,
...extraTokenParams,
Expand Down
1 change: 1 addition & 0 deletions src/TokenClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface ExchangeCredentialsArgs {
export interface ExchangeRefreshTokenArgs {
client_id?: string;
client_secret?: string;
redirect_uri?: string;

grant_type?: string;
refresh_token: string;
Expand Down
1 change: 1 addition & 0 deletions src/UserManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ export class UserManager {
const state = new RefreshState(user as Required<User>);
return await this._useRefreshToken({
state,
redirect_uri: requestArgs.redirect_uri,
resource: requestArgs.resource,
extraTokenParams: requestArgs.extraTokenParams,
});
Expand Down

0 comments on commit 4ac6dda

Please sign in to comment.