Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support oidc webauthn sequencing mode #318

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

natalian98
Copy link
Contributor

This PR adds support for authentication factors sequencing:

  • updates the reset-identity-mfa action to include webauthn
  • adds a config option enable_oidc_webauthn_sequencing
  • updates the kratos config template
  • updates the kratos-info lib to include the mode - adds oidc_webauthn_sequencing_enabled to relation data.

@natalian98 natalian98 requested a review from a team as a code owner January 15, 2025 14:50
@@ -926,6 +927,7 @@ def _update_kratos_info_relation_data(self, event: RelationEvent) -> None:
schemas_configmap_name = self.schemas_configmap.name
configmaps_namespace = self.model.name
mfa_enabled = self.config.get("enforce_mfa")
oidc_webauthn_sequencing_enabled = self.config.get("enable_oidc_webauthn_sequencing")
Copy link
Contributor

Choose a reason for hiding this comment

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

would it be ok to provide a default value here?

Suggested change
oidc_webauthn_sequencing_enabled = self.config.get("enable_oidc_webauthn_sequencing")
oidc_webauthn_sequencing_enabled = self.config.get("enable_oidc_webauthn_sequencing", False)

@@ -529,6 +529,7 @@ def _render_conf_file(self) -> str:
enable_local_idp=self.config.get("enable_local_idp"),
enforce_mfa=self.config.get("enforce_mfa"),
enable_passwordless_login_method=self.config.get("enable_passwordless_login_method"),
enable_oidc_webauthn_sequencing=self.config.get("enable_oidc_webauthn_sequencing"),
Copy link
Contributor

Choose a reason for hiding this comment

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

and here also

@@ -8,7 +8,7 @@ identity:
- id: {{ schema_id }}
url: '{{ identity_schema }}'
{%- endfor %}
{%- if enable_local_idp and enforce_mfa %}
{%- if enable_oidc_webauthn_sequencing or enable_local_idp and enforce_mfa %}
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: can you group the conditions here so they're easier to read and, more importantly, we make sure we don't make mistake

Comment on lines +80 to +84
{%- if enable_oidc_webauthn_sequencing or enforce_mfa and enable_local_idp %}
lookup_secret:
enabled: True
{%- endif %}
{%- if enable_passwordless_login_method %}
{%- if enable_passwordless_login_method or enable_oidc_webauthn_sequencing %}
Copy link
Contributor

Choose a reason for hiding this comment

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

same suggestion here

Copy link
Contributor

@wood-push-melon wood-push-melon left a comment

Choose a reason for hiding this comment

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

Agree with Marco's comments. Other parts LGTM.

Just one dummy question:
do we need to increase the lib's major version since we changed the public API of the provider?

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