Repository navigation
Feat/admin audit logging - #1578
Open
GhassenKefi wants to merge 4 commits into
Open
GhassenKefi wants to merge 4 commits into
GhassenKefi wants to merge 4 commits into
Conversation
Creating, updating and deleting an OpenID Connect provider is now written to the admin audit log, both from the admin settings and through occ user_oidc:provider and user_oidc:provider:delete. An occ call that only shows a provider is not logged. The entries carry the provider ID and identifier, and for created and updated providers the client ID and discovery endpoint. The client secret is never logged: an update only records whether a new secret was set (clientSecretChanged). An update also lists the keys of the provider settings whose value changed (changedSettings), such as the bearer token check or the group restriction, without their values. The operations are collected in the new OCA\UserOIDC\AuditLog\Operation enum, with a short description of each for the documentation, and are dispatched through the new AuditLogger service. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
…t log Enabling or disabling the login with ID4me and storing the tokens users obtain at login (store_login_token) are now written to the admin audit log with the new value. The ID4me change is logged in ID4MeService::setID4ME, where the value is stored. The login token storage is only logged for values the admin settings actually store, so unsupported keys or non-boolean values are not logged. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
An account created in this backend through the provisioning API (OcsApiController::createUser), on the first request with a bearer token of an unknown user, or on the first ID4me login is now written to the admin audit log as user_oidc.user.provisioned, with the user ID, the provider ID and the source of the provisioning (provisioning_api, bearer_token or id4me_login). For ID4me, the provider ID is the ID of the ID4me authority. None of these paths dispatches a UserCreatedEvent, so the creation was not visible in the audit log before. The OpenID Connect code flow login is left out: it already dispatches UserCreatedEvent and the login events, which admin_audit logs. UserMapper::getOrCreate() now reports through an optional by-reference argument whether it inserted the user, so an existing account, also one known under another user ID than the token user ID, is not logged again on every request. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
…t log A code flow login that user_oidc rejects is now written to the admin audit log as user_oidc.login.failed, with a short reason, the provider ID when it is known and the user ID once it has been read from the ID token. The reasons are idp_error, state_expired, state_mismatch, token_request_failed, invalid_token (signature check failed), token_expired, invalid_issuer, invalid_audience, invalid_azp, invalid_nonce, missing_user_id, not_in_whitelisted_group, user_conflict and provisioning_failed. None of these paths dispatches AnyLoginFailedEvent, so they were not in the audit log before. The authorization code, the tokens, the state and the error description of the identity provider are never logged. A failure to decrypt the client secret is not logged, as it is a configuration error and not a rejected login. A session revoked by a back-channel logout from the identity provider is now logged as user_oidc.session.revoked with the user ID, the provider and the ID of the revoked auth token. No core event logged by admin_audit fires when the token is invalidated this way. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
GhassenKefi
force-pushed
the
feat/admin-audit-logging
branch
from
October 20, 2026 15:46
fafcfd0 to
da07e56
Compare
Author
|
since user_oidc support |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI (if applicable)