diff --git a/addons/core/public/auth-pending.svg b/addons/core/public/auth-pending.svg new file mode 100644 index 000000000..da6811493 --- /dev/null +++ b/addons/core/public/auth-pending.svg @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml index af1d3d2a1..e524bfdab 100644 --- a/addons/core/translations/resources/en-us.yaml +++ b/addons/core/translations/resources/en-us.yaml @@ -72,6 +72,7 @@ auth-method: delete: Delete Auth Method make-primary: Make Primary remove-as-primary: Remove as Primary + no-new-window-retry: Don't see the new window? Retry notifications: make-primary-success: Auth method successfully elected to primary. remove-as-primary-success: Auth method successfully removed as primary. @@ -80,7 +81,6 @@ auth-method: remove-as-primary: Remove primary auth method? make-primary-confirm: 'A primary auth method auto-creates users on their first authentication attempt if needed. Note: if you change the primary auth method, the previous primary will no longer auto-create users.' remove-as-primary-confirm: Removing the primary auth method may lead to authentication failures for this scope. - no-see-window: Don't see the new window? form: urls: label: Server address (URL and port) diff --git a/ui/admin/app/controllers/scopes/scope/authenticate.js b/ui/admin/app/controllers/scopes/scope/authenticate.js index ca03404e6..d84cab299 100644 --- a/ui/admin/app/controllers/scopes/scope/authenticate.js +++ b/ui/admin/app/controllers/scopes/scope/authenticate.js @@ -4,8 +4,11 @@ */ import Controller from '@ember/controller'; +import { service } from '@ember/service'; export default class ScopesScopeAuthenticateController extends Controller { + @service router; + // =attributes /** @@ -19,4 +22,15 @@ export default class ScopesScopeAuthenticateController extends Controller { ...this.model.scopes.filter((scope) => scope.id !== 'global'), ]; } + + /** + * Checks if the current route is the OIDC method authentication route. + * @type {boolean} + * @returns {boolean} + */ + get isOIDCRoute() { + return ( + this.router.currentRouteName === 'scopes.scope.authenticate.method.oidc' + ); + } } diff --git a/ui/admin/app/controllers/scopes/scope/authenticate/method/oidc.js b/ui/admin/app/controllers/scopes/scope/authenticate/method/oidc.js index 5ff97b3e1..df541d8ce 100644 --- a/ui/admin/app/controllers/scopes/scope/authenticate/method/oidc.js +++ b/ui/admin/app/controllers/scopes/scope/authenticate/method/oidc.js @@ -13,19 +13,14 @@ export default class ScopesScopeAuthenticateMethodOidcController extends Control // =services @service session; - + @service router; // =actions /** * Retry by starting a new OIDC authentication flow. - * @param {object} e */ @action - async retryAuthentication(e) { - // TODO: This event handler can be removed when rose dialog gets - // refactored to use hds. - e.preventDefault(); - + async retryAuthentication() { const scope = this.authMethod.scope; const authenticatorName = `authenticator:${this.authMethod.type}`; await this.authenticateMethod.startOIDCAuthentication(authenticatorName, { diff --git a/ui/admin/app/templates/scopes/scope/authenticate.hbs b/ui/admin/app/templates/scopes/scope/authenticate.hbs index e741de84a..d34b96b5e 100644 --- a/ui/admin/app/templates/scopes/scope/authenticate.hbs +++ b/ui/admin/app/templates/scopes/scope/authenticate.hbs @@ -10,77 +10,84 @@ - - <:header> - - {{t 'actions.authenticate'}} - - <:body> - {{t - 'auth.descriptions.authenticating-with-org' - name=@model.scope.displayName - }} + {{#if this.isOIDCRoute}} + {{outlet}} + {{else}} + + <:header> + + {{t 'actions.authenticate'}} + + <:body> + {{t + 'auth.descriptions.authenticating-with-org' + name=@model.scope.displayName + }} - - - {{t 'titles.global'}} - - - {{#each this.sortedScopes as |scope|}} - - {{scope.displayName}} + + + {{t 'titles.global'}} - {{/each}} - - + {{#each this.sortedScopes as |scope|}} + + {{scope.displayName}} + - - {{#each @model.authMethods as |authMethod|}} - - {{#if authMethod.name}} - {{authMethod.name}} - {{else}} - {{t (concat 'resources.auth-method.types.' authMethod.type)}} - {{/if}} - - {{/each}} + {{/each}} + + - + + {{#each @model.authMethods as |authMethod|}} + + {{#if authMethod.name}} + {{authMethod.name}} + {{else}} + {{t + (concat 'resources.auth-method.types.' authMethod.type) + }} + {{/if}} + + {{/each}} - {{#if @model.authMethods}} - {{outlet}} - {{/if}} - {{#unless @model.authMethods}} - - - - - - - {{/unless}} - - + + + {{#if @model.authMethods}} + {{outlet}} + {{else}} + + + + + + + {{/if}} + + + {{/if}} diff --git a/ui/admin/app/templates/scopes/scope/authenticate/method/oidc.hbs b/ui/admin/app/templates/scopes/scope/authenticate/method/oidc.hbs index 39f7a864a..a7e3d8f82 100644 --- a/ui/admin/app/templates/scopes/scope/authenticate/method/oidc.hbs +++ b/ui/admin/app/templates/scopes/scope/authenticate/method/oidc.hbs @@ -3,25 +3,23 @@ SPDX-License-Identifier: BUSL-1.1 }} - - <:header> - {{inline-svg 'logo-app-full'}} - {{t - 'resources.auth-method.messages.pending.title' - }} - - <:body> -

{{t 'resources.auth-method.messages.pending.description'}}

-

- {{t 'resources.auth-method.questions.no-see-window'}} - - {{t 'actions.retry'}} - -

-

- - {{t 'actions.cancel'}} - -

- -
\ No newline at end of file + + + {{! We are not using the component here due to a CSP violation caused by the use of inline styles on this image. }} + + + + + + + + + \ No newline at end of file diff --git a/ui/desktop/app/controllers/scopes/scope/authenticate.js b/ui/desktop/app/controllers/scopes/scope/authenticate.js index 307e5831b..9f437e7ac 100644 --- a/ui/desktop/app/controllers/scopes/scope/authenticate.js +++ b/ui/desktop/app/controllers/scopes/scope/authenticate.js @@ -10,6 +10,7 @@ export default class ScopesScopeAuthenticateController extends Controller { // =services @service clusterUrl; + @service router; // =attributes @@ -23,4 +24,15 @@ export default class ScopesScopeAuthenticateController extends Controller { ...this.model.scopes.filter((scope) => scope.id !== 'global'), ]; } + + /** + * Checks if the current route is the OIDC method authentication route. + * @type {boolean} + * @returns {boolean} + */ + get isOIDCRoute() { + return ( + this.router.currentRouteName === 'scopes.scope.authenticate.method.oidc' + ); + } } diff --git a/ui/desktop/app/controllers/scopes/scope/authenticate/method/oidc.js b/ui/desktop/app/controllers/scopes/scope/authenticate/method/oidc.js index 597680cf3..9a9caa640 100644 --- a/ui/desktop/app/controllers/scopes/scope/authenticate/method/oidc.js +++ b/ui/desktop/app/controllers/scopes/scope/authenticate/method/oidc.js @@ -13,19 +13,15 @@ export default class ScopesScopeAuthenticateMethodOidcController extends Control // =services @service session; + @service router; // =actions /** * Retry by starting a new OIDC authentication flow. - * @param {object} e */ @action - async retryAuthentication(e) { - // TODO: This event handler can be removed when rose dialog gets - // refactored to use hds. - e.preventDefault(); - + async retryAuthentication() { const scope = this.authMethod.scope; const authenticatorName = `authenticator:${this.authMethod.type}`; await this.authenticateMethod.startOIDCAuthentication(authenticatorName, { diff --git a/ui/desktop/app/templates/scopes/scope/authenticate.hbs b/ui/desktop/app/templates/scopes/scope/authenticate.hbs index dea545b3f..fd675e3a4 100644 --- a/ui/desktop/app/templates/scopes/scope/authenticate.hbs +++ b/ui/desktop/app/templates/scopes/scope/authenticate.hbs @@ -6,67 +6,70 @@ {{page-title (t 'actions.authenticate')}}
- - - - - {{t 'titles.global'}} - - {{#each this.sortedScopes as |scope|}} - - {{scope.displayName}} + + + + {{t 'titles.global'}} - {{/each}} - + {{#each this.sortedScopes as |scope|}} + + {{scope.displayName}} + + {{/each}} + - - {{#each @model.authMethods as |authMethod|}} - - {{#if authMethod.name}} - {{authMethod.name}} - {{else}} - {{t (concat 'resources.auth-method.types.' authMethod.type)}} - {{/if}} - - {{/each}} - + + {{#each @model.authMethods as |authMethod|}} + + {{#if authMethod.name}} + {{authMethod.name}} + {{else}} + {{t (concat 'resources.auth-method.types.' authMethod.type)}} + {{/if}} + + {{/each}} + - {{#if @model.authMethods}} - {{outlet}} - {{/if}} - {{#unless @model.authMethods}} - - - - - - - {{/unless}} -

- {{t 'cluster-url.connected-to'}}: - {{this.clusterUrl}} -
- - {{t 'actions.change-cluster-url'}} - -

-
+ {{#if @model.authMethods}} + {{outlet}} + {{else}} + + + + + + + {{/if}} +

+ {{t 'cluster-url.connected-to'}}: + {{this.clusterUrl}} +
+ + {{t 'actions.change-cluster-url'}} + +

+ + {{/if}}
\ No newline at end of file diff --git a/ui/desktop/app/templates/scopes/scope/authenticate/method/oidc.hbs b/ui/desktop/app/templates/scopes/scope/authenticate/method/oidc.hbs index beb979708..49077d247 100644 --- a/ui/desktop/app/templates/scopes/scope/authenticate/method/oidc.hbs +++ b/ui/desktop/app/templates/scopes/scope/authenticate/method/oidc.hbs @@ -3,24 +3,22 @@ SPDX-License-Identifier: BUSL-1.1 }} - - <:header> - {{t - 'resources.auth-method.messages.pending.title' - }} - - <:body> -

{{t 'resources.auth-method.messages.pending.description'}}

-

- {{t 'resources.auth-method.questions.no-see-window'}} - - {{t 'actions.retry'}} - -

-

- - {{t 'actions.cancel'}} - -

- -
\ No newline at end of file + + + + + + + + + + + \ No newline at end of file