Single sign-on (SSO)#
With single sign-on, users sign in to Empowerment Center with their organization's account (Microsoft Entra ID, Keycloak, ADFS, Okta, Google Workspace…) instead of with a password of their own. ECenter supports OIDC (OpenID Connect) and SAML 2.0 providers, several at the same time.
How it works#
The identity provider only says who the person is. The account, the roles and the privileges are always those of ECenter:
- An enabled user with the same login the provider gives (case-insensitive) has to exist in ECenter. If it does not exist, there is no session.
- SSO does not create users or assign them roles. For the provider to create, change and remove users automatically, also use SCIM.
- If the ECenter user has no email, the one the provider gives is copied. If they already have one, it is not touched. If the provider's email is used by another user, it is not copied, the user signs in anyway and it is recorded in the audit.
- Signing in with a password is still available to users who have one. A user without a password only signs in with the provider.
The sign-in screen shows a Continue with … button per provider, with the name configured for it, and below it the user and password form (“or with your Empowerment Center user”). Without any provider configured, it only asks for user and password.


Before you start#
- Access to the server configuration: providers are defined in the installation's own
application.yml(see Configuration), not from the application. A restart is needed. - The proxy passing the
X-Forwarded-*headers to the backend (and, without containers,SERVER_FORWARD_HEADERS_STRATEGY=framework): the return addresses registered in the provider come from the original request that the backend rebuilds with them, not fromECENTER_PUBLIC_URL. The frontend image already forwards the SSO routes to the server (/oauth2/,/login/oauth2/,/saml2/and/login/saml2/); a proxy of your own has to do the same (see Installation). - Permission to register an application in the identity provider.
- Users created in ECenter with the login the provider will give, or SCIM provisioning.
Configure an OIDC provider#
-
Register ECenter as a web application in the provider, with this redirect address:
<id>is the name you will give the registration in ECenter (for example,empresa). -
Note the client identifier, the secret and the issuer address.
-
Add the registration to your own
application.yml: -
Put the identifier and the secret in the environment file (
OIDC_CLIENT_ID,OIDC_CLIENT_SECRET), not in theapplication.yml. - Restart the server and check that the sign-in screen shows Continue with Company account.
By default, the ECenter login is the provider's preferred_username claim and the email is email (only if the provider does not say it is unverified). To change them, see ECenter options per provider.
Configure a SAML provider#
-
Add the registration to your own
application.yml, with an<id>(for example,adfs) and the address of the provider's metadata:spring: security: saml2: relyingparty: registration: adfs: entity-id: https://ecenter.example.org/saml2/service-provider-metadata/adfs assertingparty: metadata-uri: https://adfs.example.org/FederationMetadata/2007-06/FederationMetadata.xml ecenter: security: sso: providers: adfs: name: Corporate directory # SAML has no name of its own: without this, the button shows the id -
Restart the server.
-
In the provider, register ECenter with its metadata, which it publishes at
https://ecenter.example.org/saml2/service-provider-metadata/adfs. If you cannot import it, these are the details:Item Value Identifier (entity ID) The registration's entity-idAssertion consumer service (ACS) https://ecenter.example.org/login/saml2/sso/adfs -
Configure which value the provider sends as NameID: by default, it is the ECenter login.
If the provider requires requests to be signed, add ECenter's key and certificate to the registration (signing.credentials[0].private-key-location and signing.credentials[0].certificate-location, with file: paths to files mounted on the server).
The SAML response arrives from the provider's domain; ECenter keeps the request in progress in its database for 10 minutes, so it also works with several instances.
ECenter options per provider#
Besides the standard registration, each provider accepts these properties with the same <id>:
| Property | Default | What it does |
|---|---|---|
ecenter.security.sso.providers.<id>.name |
The client-name (OIDC) or the id (SAML) |
The button text: Continue with and this name. |
ecenter.security.sso.providers.<id>.login-attribute |
preferred_username (OIDC) or the NameID (SAML) |
The provider's value used as the ECenter login. |
ecenter.security.sso.providers.<id>.email-attribute |
email |
The provider's value with the email, which is copied if the user has none. |
ecenter.security.sso.providers.<id>.provider-logout |
false |
Whether Sign out also closes the provider's session (see below). |
A property written without a value takes the default.
Examples#
In the Entra portal, register an application (web platform) with the redirect address https://ecenter.example.org/login/oauth2/code/empresa, create a client secret and note the tenant identifier.
spring:
security:
oauth2:
client:
registration:
empresa:
client-id: ${OIDC_CLIENT_ID}
client-secret: ${OIDC_CLIENT_SECRET}
scope: openid,profile,email
client-name: Microsoft account
provider:
empresa:
issuer-uri: https://login.microsoftonline.com/<tenant>/v2.0
Entra's preferred_username is usually the user principal name (maria.garcia@empresa.example): create the ECenter users with that login, or change login-attribute.
In the Keycloak realm, create a confidential OpenID Connect client with Valid redirect URIs https://ecenter.example.org/login/oauth2/code/keycloak.
spring:
security:
oauth2:
client:
registration:
keycloak:
client-id: ecenter
client-secret: ${OIDC_CLIENT_SECRET}
scope: openid,profile,email
client-name: Keycloak
provider:
keycloak:
issuer-uri: https://idp.example.org/realms/<realm>
The preferred_username is the Keycloak user name.
In the realm, create a SAML client with a Client ID equal to ECenter's entity-id, Valid redirect URIs with the ECenter address and, in its options, Force name ID format with the username format, so that the NameID is the user name.
How each user is linked#
On returning from the provider, ECenter looks for a user with the login the provider gives (the login-attribute), case-insensitive:
| Result | What the user sees |
|---|---|
| It exists and is enabled | They sign in with the roles and privileges of that ECenter user, whether or not it has a password. |
| It does not exist, or is not enabled | “The identity provider recognized you, but you do not have an enabled user in Empowerment Center. Ask an administrator to create one for you.” It is recorded in the audit as a failed attempt. |
| The provider fails or its response is not valid | “Sign-in with the identity provider failed. Please try again.” |
For a user who already existed to sign in through SSO, their login has to match the provider's value. If it does not match, change it with Change login… in their detail (see Users). So that they can only sign in through SSO, do not give them a password.
Important
The login is what matches the provider's account with the ECenter one. Whoever can change logins decides who signs in to each account; that is why the login of a user with System administration can only be changed by someone who also has it. Always keep some local administrator with a password so you can sign in if the provider fails.
Sign out#
By default, Sign out only closes the ECenter session: the provider's stays open and signing in again does not ask for the password. On a shared workstation it is advisable to close the provider's as well. It is enabled per provider:
ECenter sends the user to the provider's sign-out service (the end_session_endpoint it announces in its discovery), which returns them to https://ecenter.example.org/login. Register that address in the provider as the return address after signing out: in Keycloak, Valid post logout redirect URIs; in Entra, among the application's redirect addresses.
ECenter sends the provider a signed sign-out request. It needs:
spring:
security:
saml2:
relyingparty:
registration:
adfs:
signing.credentials[0].private-key-location: file:/etc/ecenter/saml/clave.pem
signing.credentials[0].certificate-location: file:/etc/ecenter/saml/certificado.pem
singlelogout.url: "{baseUrl}/login/saml2/slo/{registrationId}"
singlelogout.response-url: "{baseUrl}/login/saml2/slo/{registrationId}"
In the provider, ECenter's sign-out address is https://ecenter.example.org/login/saml2/slo/adfs (its metadata announces it). If the provider receives the sign-out through a form, add its origin to ECENTER_CSP_IDP_ORIGINS.
On returning, the sign-in screen says “You have signed out of Empowerment Center and of “…”.”. The ECenter session is always closed, even if the provider's fails.
A half-done configuration prevents the server from starting: provider-logout on a provider that does not exist, on an OIDC one that does not announce a sign-out service, or on a SAML one without a sign-out service in its metadata or without signing credentials.
Sign-out initiated by the provider (signing out of another application and having ECenter close) is not supported: the ECenter session continues until it expires or the user signs out.
Common problems#
| Symptom | Probable cause | Solution |
|---|---|---|
| The provider's button does not appear | The registration has not been read: the application.yml is not mounted or has an error. |
Check the file and the server log at startup. |
| The provider says the redirect address is not valid | The registered address does not match the one ECenter sends. | Check that the proxy passes the X-Forwarded-Proto and X-Forwarded-Host headers (see Installation); register exactly https://…/login/oauth2/code/<id>. |
| “…you do not have an enabled user in Empowerment Center…” | There is no user with that login, or it is disabled or locked. | Look in the audit for the login that arrived and create the user with that login, or change login-attribute. |
| “Sign-in with the identity provider failed…” | Invalid response: signature, clock out of sync, expired certificate or changed metadata. | Check the server log and the provider's metadata. |
| The user signs in without an email | The provider does not send the email-attribute value, or another user uses it. |
Configure the value in the provider or adjust email-attribute; if another user uses it, the audit says so. |
See also#
- SCIM provisioning
- Users
- Sessions and sign-in
- Configuration
- Integrations: the MCP with the organization's account (OAuth)