Skip to content

Conversation

@jvillafanez
Copy link
Member

Description

Configuration changes for keycloak in order to provide a login flow with step up mechanism as described in https://www.keycloak.org/docs/latest/server_admin/index.html#_step-up-flow.

Note that the changes shouldn't affect the current setup, and the "new" authentication flow isn't active by default.
In order to activate it:

  1. Go to keycloak admin console -> oCIS realm -> authentication -> flows.
  2. Click on the "step up flow" (which should be marked as "not in use")
  3. In the "actions" menu (top right), choose "bind flow", and then choose "browser flow".

At the moment, the server won't do anything with the new information, and the clients don't support the feature (not tested, but they might have problems). You can use https://playground.please-open.it/ to play around

Related Issue

Preparations for https://github.com/owncloud/enterprise/issues/7292

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@update-docs
Copy link

update-docs bot commented Aug 8, 2025

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 8, 2025

@jvillafanez jvillafanez self-assigned this Aug 11, 2025
@jvillafanez jvillafanez marked this pull request as ready for review August 11, 2025 08:54
"alias" : "loa level 2",
"config" : {
"loa-condition-level" : "2",
"loa-max-age" : "36000"
Copy link
Member

@mklos-kw mklos-kw Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: For demonstration purposes token expiry for level 2 can be shorter than level 1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's the default value, so I'd keep it for now. If we need to change it to test something, it can be changed both from this configuration file as well as from the web UI

"clientSessionMaxLifespan": "0",
"organizationsEnabled": "false"
"organizationsEnabled": "false",
"acr.loa.map" : "{\"regular\":\"1\",\"advanced\":\"2\"}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC: No acr in request to keycloak will be level 1, isn't it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no explicit level is requested by parameters, the Keycloak will require the authentication with the first LoA condition found in the authentication flow, such as the Username/Password in the preceding example. When a user was already authenticated with that level and that level expired, the user is not required to re-authenticate, but acr in the token will have the value 0. This result is considered as authentication based solely on long-lived browser cookie as mentioned in the section 2 of OIDC Core 1.0 specification.

That's what I've found in the keycloak docs (in https://www.keycloak.org/docs/latest/server_admin/index.html#_step-up-flow, check for "Flow logic" section)

@mklos-kw
Copy link
Member

Thank you for referencing the Keycloak docs and the playground. Looks good to me!

@jvillafanez jvillafanez merged commit e80f38d into master Aug 14, 2025
2 checks passed
@jvillafanez jvillafanez deleted the keycloak_stepup_flow_example branch August 14, 2025 12:37
ownclouders pushed a commit that referenced this pull request Aug 14, 2025
feat: add step up auth flow in keycloak example
ownclouders pushed a commit that referenced this pull request Aug 15, 2025
feat: add step up auth flow in keycloak example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants