OpenID Connect (OIDC) Login & Registration
Artemis supports decentralized user login and identity synchronization using OpenID Connect (OIDC). The OIDC feature acts as a secure, high-precedence authentication bridge. It allows identity providers to securely transmit verified student claims, including the matriculation number, name, and email directly into the Artemis ecosystem.
When a user authenticates via the OIDC provider for the first time, Artemis invokes Just-In-Time (JIT) provisioning. This automatically builds a native, stateless account record in the local database, extracting and mapping key attributes dynamically from the secure ID token.
- The feature is fully controlled by the
artemis.user-management.oidc.enabled: truemodule-feature flag. - If you run the system behind a reverse proxy, you must explicitly forward the following secure endpoints to the Artemis core instance: /oauth2/ and /login/oauth2/.
Architecture and Filtering Mechanics
The OIDC ecosystem leverages Spring Security's OAuth2 Client libraries to inject an isolated, decoupled filter chain. This chain intercepts requests, ensuring OIDC callbacks are parsed and verified before hitting default platform filters.
The login does not use an HTTP session. When it starts, Artemis stores the pending authorization request, with its state and nonce, in the distributed data store for 10 minutes, so the callback of the identity provider can reach any node. A load balancer does not need sticky sessions for OIDC. The browser receives the state in the HTTP-only oidc-state cookie, and Artemis accepts a callback only if its state matches that cookie. Each authorization request can be used once. The cookie is Secure like the session cookie, so jhipster.security.authentication.jwt.cookie-secure: false also allows OIDC logins on a deployment reached over plain HTTP.
Rate Limiting Behind a Reverse Proxy
The unauthenticated /oauth2/authorization/oidc endpoint is rate-limited per client address to protect the distributed authorization-request store when rate limiting is enabled. Enforcement requires both artemis.rate-limiting.enabled and the RateLimit feature toggle to be enabled. Addresses listed in artemis.rate-limiting.exempt-addresses bypass the limit. The OIDC filter uses the address resolved by the servlet container (request.getRemoteAddr()) rather than trusting X-Forwarded-For directly.
If a reverse proxy is not trusted by Tomcat, all its users can appear under the proxy's address and share one OIDC rate-limit bucket. A busy campus or a single abusive client can then prevent others from starting login. With server.request.header.forwarded.strategy: web-server, configure server.tomcat.remoteip.internal-proxies to include any reverse proxy outside Tomcat's default trusted ranges. For example, for a proxy whose address is 203.0.113.10:
server:
request:
header:
forwarded:
strategy: web-server
tomcat:
remoteip:
internal-proxies: "203\\.0\\.113\\.10"
Replace the example with the actual proxy address and account for all trusted proxies in the deployment. Trust only proxies under your control: they must sanitize forwarding headers, and untrusted clients must not be able to reach Artemis directly. Restricting Tomcat's default trust of private addresses may also be necessary in deployments with untrusted internal clients. The artemis.continuous-integration.build-agent-network.trusted-proxies setting does not configure Tomcat's address resolution for OIDC.
Do not add the reverse proxy to artemis.rate-limiting.exempt-addresses to avoid shared buckets: doing so exempts every client represented by that address. Where many legitimate users share a source address behind NAT, adjust artemis.rate-limiting.oidc-authorization-requests-per-minute to accommodate expected login peaks.
Configuration Specification
The structure of the OIDC infrastructure configuration (standardized inside application-oidc.yml) dictates how Artemis bonds with the university identity pool:
artemis:
user-management:
oidc:
enabled: true
mappings:
username: "preferred_username"
matriculation-number: "matriculation_number"
first-name: "given_name"
last-name: "family_name"
email: "email"
spring:
security:
oauth2:
client:
registration:
oidc:
provider: oidc
client-id: "${ARTEMIS_OIDC_CLIENT_ID:placeholder-artemis-client-id}"
client-secret: "${ARTEMIS_OIDC_CLIENT_SECRET:placeholder-artemis-client-secret}"
scope:
- "openid"
- "profile"
- "email"
redirect-uri: "{baseUrl}/login/oauth2/code/{registrationId}"
authorization-grant-type: "authorization_code"
provider:
oidc:
issuer-uri: "${ARTEMIS_OIDC_ISSUER_URI:https://tumidp.lrz.de/idp/shibboleth}"
authorization-uri: "${ARTEMIS_OIDC_AUTHORIZATION_URI:https://login.tum.de/idp/profile/oidc/authorize}"
token-uri: "${ARTEMIS_OIDC_TOKEN_URI:https://login.tum.de/idp/profile/oidc/token}"
user-info-uri: "${ARTEMIS_OIDC_USER_INFO_URI:https://login.tum.de/idp/profile/oidc/userinfo}"
jwk-set-uri: "${ARTEMIS_OIDC_JWK_SET_URI:https://login.tum.de/idp/profile/oidc/keyset}"
info:
oidc:
# Customizable string used for the external login selection screen button (e.g. 'TUM Login')
buttonLabel: "${ARTEMIS_OIDC_DISPLAY_NAME:TUM Login}"
Requested Scopes
Artemis requests the scopes openid, profile and email unless you configure others. The property spring.security.oauth2.client.registration.oidc.scope accepts every form Spring Boot supports:
- a YAML list, as in
application-oidc.yml - one comma-separated value, for example
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_SCOPE='openid,profile,email' - one indexed environment variable per scope, for example
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_SCOPE_0='openid'
At startup Artemis logs the scopes it requests (OIDC login requests the scopes [...]). Check this line first when an identity provider does not release a claim you expect.
Accounts With a Password of Their Own
An external login only works for accounts that the identity provider manages. If the login name of an external login belongs to an internal account, one with a password of its own, Artemis refuses the login and writes a warning with the login name to the server log. Users of such an account keep signing in with their password. Artemis does not merge the two kinds of accounts. Accounts that an LTI launch created and, for SAML2, accounts that Artemis created before version 9.9 and that were never converted are internal accounts too. See Accounts Provisioned Through SAML2 for the conversion of the latter.
Matriculation Number with TUM Login
TUM Login releases the matriculation number through the client-specific scope imMatrikelNr. TUM IT has to register this scope and the attribute of the same name for your client first. Request the scope and map the claim of the same name:
artemis:
user-management:
oidc:
mappings:
matriculation-number: "imMatrikelNr"
spring:
security:
oauth2:
client:
registration:
oidc:
scope: "openid,profile,email,imMatrikelNr"
Artemis stores the claim as the registration number of the account. It sets the number at the first login and updates it at later logins when it changed, unless another account already uses it. A blank or missing claim never deletes an existing number.
To see which claims an identity provider releases, look for this line in the server log after a login. It lists the claim names of the ID token and of the userinfo response, never their values, and states whether the configured matriculation claim is present:
OIDC login received the claims [...] in the ID token and [...] in the userinfo response. The configured matriculation claim 'imMatrikelNr' is present.
If the claim is missing, check the startup line for the requested scopes first, then ask the identity provider whether the scope is registered for your client.