diff --git a/src/auth/FormElement.ts b/src/auth/FormElement.ts index c253e12f736d..1f39d65621a3 100644 --- a/src/auth/FormElement.ts +++ b/src/auth/FormElement.ts @@ -51,6 +51,7 @@ export default class GmfAuthForm extends GmfBaseElement { @state() private twoFactorAuth = false; @state() private allowPasswordChange = false; @state() private allowPasswordReset = false; + @state() private oidcUserInformationUrl = ''; @state() private changingPassword = false; @state() private userMustChangeItsPassword = false; @state() private openIdConnectUrl = ''; @@ -122,6 +123,7 @@ export default class GmfAuthForm extends GmfBaseElement { this.twoFactorAuth = configuration.gmfTwoFactorAuth; this.allowPasswordChange = configuration.gmfAuthenticationConfig.allowPasswordChange; this.allowPasswordReset = configuration.gmfAuthenticationConfig.allowPasswordReset; + this.oidcUserInformationUrl = configuration.gmfAuthenticationConfig.oidcUserInformationUrl; this.openIdConnectBaseUrl = configuration.gmfOidcLoginUrl; if (configuration.gmfCustomCSS && configuration.gmfCustomCSS.authentication !== undefined) { this.customCSS_ = configuration.gmfCustomCSS.authentication; @@ -181,6 +183,17 @@ export default class GmfAuthForm extends GmfBaseElement { ${this.gmfUser.username}. + ${this.oidcUserInformationUrl + ? html` +
+ ${i18next.t('User information on the OIDC service')} +
+ ` + : html``} ${!this.changingPassword ? html`
this.logout(evt)}> diff --git a/src/options.js b/src/options.js index 729eab04035f..0d3c49767ff3 100644 --- a/src/options.js +++ b/src/options.js @@ -1,6 +1,6 @@ // The MIT License (MIT) // -// Copyright (c) 2020-2024 Camptocamp SA +// Copyright (c) 2020-2025 Camptocamp SA // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in @@ -672,6 +672,7 @@ export function buildStyle(styleDescriptor) { * @property {boolean} allowPasswordReset Whether to show the password forgotten link. Default to true. * @property {boolean} allowPasswordChange Whether to show the change password button. Default to true. * You can also specify a `PasswordValidator` object to add constraint on user's new password. + * @property {string} [oidcUserInformationUrl] The URL of the OIDC server to allows the user to get his profile information. */ /** diff --git a/srcapi/store/config.ts b/srcapi/store/config.ts index 3e0b462cfb87..983dc2299a59 100644 --- a/srcapi/store/config.ts +++ b/srcapi/store/config.ts @@ -1,6 +1,6 @@ // The MIT License (MIT) // -// Copyright (c) 2020-2024 Camptocamp SA +// Copyright (c) 2020-2025 Camptocamp SA // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in @@ -979,6 +979,10 @@ export type gmfAuthenticationConfig = { * You can also specify a `PasswordValidator` object to add constraint on user's new password. */ allowPasswordChange: boolean; + /** + * The URL of the OIDC server to allows the user to get his profile information. + */ + oidcUserInformationUrl?: string; }; /**