2023-03-01 09:39:41 -06:00
|
|
|
/**
|
2026-01-28 17:09:06 -08:00
|
|
|
* Copyright IBM Corp. 2021, 2026
|
2024-05-31 11:29:24 -07:00
|
|
|
* SPDX-License-Identifier: BUSL-1.1
|
2023-03-01 09:39:41 -06:00
|
|
|
*/
|
|
|
|
|
|
2025-01-07 10:56:32 -08:00
|
|
|
import Controller, { inject as controller } from '@ember/controller';
|
2025-03-12 08:29:54 -07:00
|
|
|
import { service } from '@ember/service';
|
2025-01-07 10:56:32 -08:00
|
|
|
import { action } from '@ember/object';
|
2021-04-12 17:10:55 -04:00
|
|
|
|
|
|
|
|
export default class ScopesScopeAuthenticateMethodOidcController extends Controller {
|
2025-01-07 10:56:32 -08:00
|
|
|
@controller('scopes/scope/authenticate/method/index') authenticateMethod;
|
|
|
|
|
|
2021-04-12 17:10:55 -04:00
|
|
|
// =services
|
|
|
|
|
|
|
|
|
|
@service session;
|
2025-04-18 12:42:18 -07:00
|
|
|
@service router;
|
2025-01-07 10:56:32 -08:00
|
|
|
// =actions
|
2021-04-12 17:10:55 -04:00
|
|
|
|
|
|
|
|
/**
|
2025-01-07 10:56:32 -08:00
|
|
|
* Retry by starting a new OIDC authentication flow.
|
2021-04-12 17:10:55 -04:00
|
|
|
*/
|
2025-01-07 10:56:32 -08:00
|
|
|
@action
|
2025-04-18 12:42:18 -07:00
|
|
|
async retryAuthentication() {
|
2025-01-07 10:56:32 -08:00
|
|
|
const scope = this.authMethod.scope;
|
|
|
|
|
const authenticatorName = `authenticator:${this.authMethod.type}`;
|
|
|
|
|
await this.authenticateMethod.startOIDCAuthentication(authenticatorName, {
|
|
|
|
|
scope,
|
|
|
|
|
authMethod: this.authMethod,
|
|
|
|
|
});
|
2021-04-12 17:10:55 -04:00
|
|
|
}
|
|
|
|
|
}
|