Skip to content

Confusion over extraTokenParams and signinResourceOwnerCredentials method #2156

@evoactivity

Description

@evoactivity

This type is used for the args of the signinResourceOwnerCredentials method.

export type ProcessResourceOwnerPasswordCredentialsArgs = {
username: string;
password: string;
skipUserInfo?: boolean;
extraTokenParams?: Record<string, unknown>;
};

Suggesting a usecase like so

auth.signinResourceOwnerCredentials({
  username: formData.get('username') as string,
  password: formData.get('password') as string,
  skipUserInfo: false,
  extraTokenParams: {
    otp: formData.get('otp') as string,
  },
});

Though the actual method doesn't accept extraTokenParams

public async signinResourceOwnerCredentials({
username,
password,
skipUserInfo = false,
}: SigninResourceOwnerCredentialsArgs): Promise<User> {
const logger = this._logger.create("signinResourceOwnerCredential");

It passes this.settings.extraTokenParams directly

skipUserInfo,
extraTokenParams: this.settings.extraTokenParams,
});

I feel like if the usecase suggested by the types is in the intended use case then this needs to accept and pass the extraTokenParams here and not just the values in this.settings.extraTokenParams.

Use case is keycloak password grant with OTP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions