UI: Smoke test and add mfa validation support for standard methods (#30424)

* =VAULT-34544 userpass

* update args for okta and oidc-jwt

* add todo

* VAULT-34551 tested github login

* VAULT-34550 tested radius login

* VAULT-34545 tested ldap login

* test token
This commit is contained in:
claire bontempo 2025-04-28 12:49:27 -07:00 committed by GitHub
parent d95b487e9e
commit bdf9c4efd5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 8 additions and 6 deletions

View file

@ -57,16 +57,16 @@ export default class AuthBase extends Component<Args> {
selectedAuth: this.args.authType,
});
this.handleAuthResponse(authResponse);
this.handleAuthResponse(authResponse, this.args.authType, formData);
} catch (error) {
this.onError(error as Error);
}
})
);
handleAuthResponse(authResponse: AuthData) {
handleAuthResponse(authResponse: AuthData, authType: string, formData?: object) {
// calls onAuthResponse in parent auth/page.js component
this.args.onSuccess(authResponse);
this.args.onSuccess(authResponse, authType, formData);
}
onError(error: Error | string) {

View file

@ -137,6 +137,7 @@ export default class AuthFormOidcJwt extends AuthBase {
async continueLogin(data: JwtLoginData | OidcLoginData) {
try {
// TODO backend should probably be path, but holding off refactor since api service may remove need all together
// OIDC callback returns a token so authenticate with that
const backend = this.isOIDC && 'token' in data ? 'token' : this.args.authType;
@ -146,8 +147,9 @@ export default class AuthFormOidcJwt extends AuthBase {
data,
selectedAuth: this.args.authType,
});
// responsible for redirect after auth data is persisted
this.handleAuthResponse(authResponse);
this.handleAuthResponse(authResponse, this.args.authType);
} catch (error) {
this.onError(error as Error);
}

View file

@ -45,7 +45,7 @@ export default class AuthFormOkta extends AuthBase {
selectedAuth: this.args.authType,
});
this.handleAuthResponse(authResponse);
this.handleAuthResponse(authResponse, this.args.authType);
} catch (error) {
// if a user fails the okta verify challenge, the POST login request fails (made by this.auth.authenticate above)
// bubble those up for consistency instead of managing error state in this component

View file

@ -7,7 +7,7 @@ import AuthBase from './base';
/**
* @module Auth::Form::Userpass
*
* see Auth::Base
* */
export default class AuthFormUserpass extends AuthBase {