How can I resolved Client requires user consent in keycloak?
Asked Answered
P

1

5

I need to add user consent in keycloak user when user is created. I am using API

http://localhost:8080/auth/admin/realms/master/users

and Turn on and try to create the users but I am getting error like:

Client requires user consent

I don't know which parameter I need to pass to fix this error.

Processional answered 26/5, 2021 at 3:43 Comment(0)
A
7

What is Consent ?

Consent is when you as an admin want a user to give permission to a client before that client can participate in the authentication process. After a user provides their credentials, Keycloak will pop up a screen identifying the client requesting a login and what identity information is requested of the user. User can decide whether or not to grant the request.

So what the process of creating user via api or curl command

  1. Generate the token with the help of userid/password/client/realm information
  2. Now pass this token to the create user restapi or curl command with date[username/emailid...] etc

So in your case you are getting the issue about

Client requires user consent

So it mean in your client(Which used to generate the token),Consent Required option is true in place of false. OR You are using wrong client to create the user.

enter image description here

FYI :- Generally we have two different clients for back-end and fronted application with some major differences.

Althing answered 26/5, 2021 at 8:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.