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

Docs: server_admin/topics/overview.adoc #29435

Open
2 tasks done
espinal1976 opened this issue May 10, 2024 · 17 comments
Open
2 tasks done

Docs: server_admin/topics/overview.adoc #29435

espinal1976 opened this issue May 10, 2024 · 17 comments
Assignees
Labels
area/authentication Indicates an issue on Authentication area kind/bug Categorizes a PR related to a bug status/triage team/core-clients

Comments

@espinal1976
Copy link

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

authentication

Describe the bug

File: server_admin/topics/overview.adoc

Clicking on Register on the login screen on Keycloak 24.0.3 and 24.0.4 trows:

We are sorry
Unexpected error when handling authentication request to identity provider.

Version

24.0.4

Regression

  • The issue is a regression

Expected behavior

Register link should open a form asking for the username, last name, userid and password.

Actual behavior

Clicking on Register on the login screen on Keycloak 24.0.3 and 24.0.4 trows:

We are sorry
Unexpected error when handling authentication request to identity provider.

On There server log, I got:
2024-05-10 00:13:58,381 WARN [org.keycloak.events] (executor-thread-21) type="REGISTER_ERROR", realmId="738ea455-d2eb-4784-b0f9-29a1ab536a0d", clientId="security-admin-console", userId="null", ipAddress="67.8.27.141", error="invalid_user_credentials", auth_method="openid-connect", auth_type="code", redirect_uri="https://idtest.itksoluciones.com:8445/admin/master/console/", code_id="699267c9-45a0-4dc1-92ec-87880e214fff"
2024-05-10 00:31:00,290 WARN [org.keycloak.services] (executor-thread-21) KC-SERVICES0013: Failed authentication: java.lang.NullPointerException: Cannot invoke "org.keycloak.authentication.FormAction.buildPage(org.keycloak.authentication.FormContext, org.keycloak.forms.login.LoginFormsProvider)" because "action" is null
at org.keycloak.authentication.FormAuthenticationFlow.renderForm(FormAuthenticationFlow.java:304)
at org.keycloak.authentication.FormAuthenticationFlow.processFlow(FormAuthenticationFlow.java:285)
at org.keycloak.authentication.DefaultAuthenticationFlow.processSingleFlowExecutionModel(DefaultAuthenticationFlow.java:377)
at org.keycloak.authentication.DefaultAuthenticationFlow.processFlow(DefaultAuthenticationFlow.java:246)
at org.keycloak.authentication.AuthenticationProcessor.authenticateOnly(AuthenticationProcessor.java:1051)
at org.keycloak.authentication.AuthenticationProcessor.authenticate(AuthenticationProcessor.java:892)
at org.keycloak.services.resources.LoginActionsService.processFlow(LoginActionsService.java:367)
at org.keycloak.services.resources.LoginActionsService.processRegistration(LoginActionsService.java:725)
at org.keycloak.services.resources.LoginActionsService.registerRequest(LoginActionsService.java:781)
at org.keycloak.services.resources.LoginActionsService.registerPage(LoginActionsService.java:742)
at org.keycloak.services.resources.LoginActionsService$quarkusrestinvoker$registerPage_4790ee1a00c5ff439df8d9f43fc42809e1831abf.invoke(Unknown Source)
at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:141)
at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147)
at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:582)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)

2024-05-10 00:31:00,292 WARN [org.keycloak.events] (executor-thread-21) type="REGISTER_ERROR", realmId="738ea455-d2eb-4784-b0f9-29a1ab536a0d", clientId="security-admin-console", userId="null", ipAddress="67.8.27.141", error="invalid_user_credentials", auth_method="openid-connect", auth_type="code", redirect_uri="https://idtest.itksoluciones.com:8445/admin/master/console/#/master/realm-settings/login", code_id="e39f91d2-3f4f-403a-b08e-0f1abdff8955"

How to Reproduce?

Download keycloak 24.0.4, run it, the go to Master realm, turn User registration On in Master Realm. the go and clic Register in teh login form.

Anything else?

It was working ok in keycloak 22.0.1

@espinal1976 espinal1976 added kind/bug Categorizes a PR related to a bug status/triage labels May 10, 2024
@keycloak-github-bot keycloak-github-bot bot added area/authentication Indicates an issue on Authentication area team/core-clients labels May 10, 2024
@rmartinc
Copy link
Contributor

I cannot reproduce this. I have just download 24.0.4, unzipped it, run in develompemnt, activate user registration, logout and click register. The page is correctly shown as expected. Can you please elaborate how we can test this?

@keycloak-github-bot
Copy link

Thanks for reporting this issue, but there is insufficient information or lack of steps to reproduce.

Please provide additional details, otherwise this issue will be automatically closed within 14 days.

@espinal1976
Copy link
Author

espinal1976 commented May 10, 2024 via email

@espinal1976
Copy link
Author

espinal1976 commented May 10, 2024 via email

@rmartinc
Copy link
Contributor

It's the other way around. Start with vanilla, do your changes and, when you find the issue, you have the reproducer steps you can share with us.

@espinal1976
Copy link
Author

espinal1976 commented May 11, 2024 via email

@rmartinc
Copy link
Contributor

Can you please share with us the registration flow you are using in the old version? You can do a partial export of the realm and then just copy the flow you are using for registration.

@espinal1976
Copy link
Author

espinal1976 commented May 13, 2024 via email

@rmartinc
Copy link
Contributor

You can just export using the console, select the realm affected, click Realm settings, and in the Action combo, click Partial export (groups, roles and clients not needed). If you have concerns sharing everything we are just interested in authenticationFlows section. I'm just trying to have the same config you have, because the error seems related to a missing form.

@espinal1976
Copy link
Author

espinal1976 commented May 13, 2024 via email

@rmartinc
Copy link
Contributor

rmartinc commented May 13, 2024

@espinal1976 Please upload the file using github, probably using email attachments doesn't work (at least I don't see anything in your comment).

@espinal1976
Copy link
Author

sure: backauth-realm-export.json
master-realm-export.json

Please advice if you got two files.

@rmartinc
Copy link
Contributor

Hi @espinal1976!

I have imported your json export in keycloak 22.0.1 and migrated the DB to 24.0.3 (mariadb) and I cannot reproduce your issue. My feeling is that the problem you are seeing is because the removal of the action registration-profile-action which was done in version 23.0.0. But I tested it and the migration task is correctly removing that action from the registration, so I don't really know what is happening in your env.

You can check if the action is still in your 24 environment checking the registration flow (Authentication -> Flows -> Registration), probably this will fail if the action is still there. In the database you can also do select * from AUTHENTICATION_EXECUTION where AUTHENTICATOR='registration-profile-action';. If you see a row in the different realms the migration was incorrect (don't know why) and the removed action is still present in them triggering your issue.

If that's the error please try to remember how you did the upgrade and if it's something we can reproduce.

@espinal1976
Copy link
Author

espinal1976 commented May 14, 2024 via email

@rmartinc
Copy link
Contributor

The problem with this is that we don't know how much data is incorrect. You have to check why the upgrade was not executed. The DATABASECHANGELOG contains information about the migration you can check. I would try to migrate again from the previous version until the upgrade is OK.

You can try deleting the rows at database level and restart. But you can never be sure that there are not going to be more issues.

@espinal1976
Copy link
Author

espinal1976 commented May 14, 2024 via email

@rmartinc
Copy link
Contributor

@espinal1976 We are not going to do the upgrade for you. As commented, I uploaded your export in a 22 version, upgraded to 24 and everything worked OK for me. Just try the upgrade again (in another test environment or similar) and check if the step is removed or not from the registration flow.

In general, I cannot reproduce your issue. In all my upgrade attempts, the realm was correctly updated and the registration flow didn't have the registration-profile-action step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/authentication Indicates an issue on Authentication area kind/bug Categorizes a PR related to a bug status/triage team/core-clients
Projects
None yet
Development

No branches or pull requests

2 participants