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

No authentication provider found for id: registration-page-form #896

Closed
shaidar opened this issue Nov 8, 2023 · 7 comments
Closed

No authentication provider found for id: registration-page-form #896

shaidar opened this issue Nov 8, 2023 · 7 comments
Assignees
Labels
waiting waiting for response to PR feedback

Comments

@shaidar
Copy link

shaidar commented Nov 8, 2023

Under Keycloak's Authentication when trying to create a registration flow that is basically a copy of the built-in registration flow, the registration flow has an authentication execution step that requires a registration-page-form as its authenticator. However, that throws the following error:

No authentication provider found for id: registration-page-form

Looking at the code here the endpoints specified in the comment, does not include the registration-page-form as that's available at the following endpoint:

realms/{realm}/authentication/form-action-providers
@dglozano
Copy link

Having the same issue with all the executions included in the default registration flow

@shaidar
Copy link
Author

shaidar commented Jan 7, 2025

This appears to still be an issue with Keycloak version 26.x.

@sschu
Copy link
Contributor

sschu commented Jan 8, 2025

@shaidar Have you checked this on the main branch of the provider?

@thomasdarimont
Copy link
Contributor

thomasdarimont commented Jan 8, 2025

I think you have an error in your subflow configuration.

If you want to recreate the registration flow, your keycloak_authentication_subflow resource must use

...
  provider_id = "form-flow"
...

This will create a form flow that allows to configure the FormAction executions. Otherwise a basic-flow is created.

The following works for me:

terraform {
  required_providers {
    keycloak = {
      source  = "terraform.local/keycloak/keycloak"
      version = ">= 4.5.0"
    }
  }
}

provider "keycloak" {
  client_id     = "terraform"
  client_secret = "mysecret"
  url           = "http://localhost:8080"
}

resource "keycloak_realm" "test" {
  realm             = "gh-896"
  enabled           = true
}

resource "keycloak_authentication_flow" "registration-copy" {
  alias       = "registration-copy"
  realm_id    = keycloak_realm.test.id
  description = "Custom registration"

}

resource "keycloak_authentication_subflow" "registration-copy-form" {
  realm_id          = keycloak_realm.test.id
  parent_flow_alias = keycloak_authentication_flow.registration-copy.alias
  alias             = "registration-copy-form"
  requirement       = "REQUIRED"
  description = "Custom Registration Form"
  provider_id = "form-flow"
}

resource "keycloak_authentication_execution" "register-user-profile-creation" {
  realm_id          = keycloak_realm.test.id
  parent_flow_alias = keycloak_authentication_subflow.registration-copy-form.alias
  authenticator     = "registration-user-creation"
  requirement       = "REQUIRED"
}

Yields:
image

@thomasdarimont thomasdarimont self-assigned this Jan 8, 2025
@thomasdarimont thomasdarimont added the waiting waiting for response to PR feedback label Jan 8, 2025
@shaidar
Copy link
Author

shaidar commented Jan 8, 2025

@thomasdarimont Thanks for the response. The error is actually coming from the authenticator key being set to registration-page-form which is the value we got by looking at the Keycloak json export.

That being said, trying to duplicate the registration auth flow using the UI, I don't see the registration form when adding a step, so maybe that's not even an option and just creating a custom form works just as well. If that's truly the case, then I'm somewhat unclear regarding the registration-page-form.

@thomasdarimont
Copy link
Contributor

thomasdarimont commented Jan 8, 2025

@shaidar ah I see, I think the following does what you need:

You can configure the authenticator = "registration-page-form" on the keycloak_authentication_subflow.
With that in place the representation from /admin/realms/gh-896/authentication/flows and /admin/realms/gh-896/authentication/flows/registration-copy/executions look like the versions from the original registration flow.

resource "keycloak_realm" "test" {
  realm   = "gh-896"
  enabled = true
}

resource "keycloak_authentication_flow" "registration-copy" {
  alias       = "registration-copy"
  realm_id    = keycloak_realm.test.id
  description = "Custom registration"

}

resource "keycloak_authentication_subflow" "registration-copy-form" {
  realm_id          = keycloak_realm.test.id
  parent_flow_alias = keycloak_authentication_flow.registration-copy.alias
  alias             = "registration-copy-form"
  requirement       = "REQUIRED"
  description       = "Custom Registration Form"
  authenticator     = "registration-page-form"
  provider_id       = "form-flow"
}

resource "keycloak_authentication_execution" "register-user-profile-creation" {
  realm_id          = keycloak_realm.test.id
  parent_flow_alias = keycloak_authentication_subflow.registration-copy-form.alias
  authenticator     = "registration-user-creation"
  requirement       = "REQUIRED"
}

resource "keycloak_authentication_execution" "register-validate-password" {
  realm_id          = keycloak_realm.test.id
  parent_flow_alias = keycloak_authentication_subflow.registration-copy-form.alias
  authenticator     = "registration-password-action"
  requirement       = "REQUIRED"
  depends_on = [keycloak_authentication_execution.register-user-profile-creation]
}

resource "keycloak_authentication_execution" "register-recaptcha" {
  realm_id          = keycloak_realm.test.id
  parent_flow_alias = keycloak_authentication_subflow.registration-copy-form.alias
  authenticator     = "registration-recaptcha-action"
  requirement       = "DISABLED"
  depends_on = [keycloak_authentication_execution.register-validate-password]
}

resource "keycloak_authentication_execution" "register-terms" {
  realm_id          = keycloak_realm.test.id
  parent_flow_alias = keycloak_authentication_subflow.registration-copy-form.alias
  authenticator     = "registration-terms-and-conditions"
  requirement       = "DISABLED"
  depends_on = [keycloak_authentication_execution.register-recaptcha]
}

@thomasdarimont thomasdarimont closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2025
@thomasdarimont thomasdarimont reopened this Jan 9, 2025
@shaidar
Copy link
Author

shaidar commented Jan 9, 2025

Yeah that seems to work. Thanks for the help!

@shaidar shaidar closed this as completed Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting waiting for response to PR feedback
Projects
None yet
Development

No branches or pull requests

4 participants