Aditya K
Aditya K

Reputation: 167

Setting up Keycloak for authentication

I am evaluating KeyCloak as an OpenID provider, and I'm confused about how to set it up. I'm just trying to get the simplest possible setup working.

So far I've done this:

  1. Created a realm.

  2. Registered my web application as a new client. Client protocol "open-id" and Access Type "confidential"

  3. Created a user, and set a password for it.

Then I access my web app and it redirects to the KeyCloak login page, but I keep getting "Invalid username or password."

I think I might have missed some steps with regards to client roles. Is my login failure related to this? The documentation is poor and I just want to get up and running with a basic setup.

This is the (partial) stack trace I'm getting.

10:13:56,201 WARN  [org.keycloak.services] (default task-3) KC-SERVICES0013: Failed authentication: org.keycloak.authentication.AuthenticationFlowException
        at [email protected]//org.keycloak.authentication.AuthenticationProcessor.authenticationAction(AuthenticationProcessor.java:964)
        at [email protected]//org.keycloak.services.resources.LoginActionsService.processFlow(LoginActionsService.java:294)
        at [email protected]//org.keycloak.services.resources.LoginActionsService.processAuthentication(LoginActionsService.java:265)
        at [email protected]//org.keycloak.services.resources.LoginActionsService.authenticate(LoginActionsService.java:261)
        at [email protected]//org.keycloak.services.resources.LoginActionsService.authenticateForm(LoginActionsService.java:322)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)

Upvotes: 0

Views: 5472

Answers (1)

lazyneuron
lazyneuron

Reputation: 567

Maybe you can try the following and see if it helps:

  • Please, ensure that you have created the user under the same realm, where you have configured your client under test.
  • Check that freshly created user of yours does have the following flags checked: "email is verified" and that the password is not "one time password". (It is a test user of yours after all and it should be OK for testing purposes)

P.S. The documentation is not poor by any means of evaluation.

Upvotes: 1

Related Questions