0

I need to obtain rpt in order to register new users in my app.

Keycloak.json

{
  "realm": "master",
  "auth-server-url" : "http://localhost:8180/auth",
  "resource" : "admin-cli",
  "public-client": true
}

Fetching the rpt:

@GetMapping("rpt")
public String token() {
    var username = environment.getProperty("authServer.admin.username");
    var password = environment.getProperty("authServer.admin.password");
    var req = new AuthorizationRequest();
    var res = this.authzClient.authorization(username, password).authorize(req);
    return res.getToken();
}

I get:java.lang.RuntimeException: Client secret not provided.

But I am using admin-cli that under the master realm which it's access type is public.

Already I set:

  "public-client": true

How can I obtain rpt of admin-cli? I will use it to create new users in my applications register page.

Muhammed Ozdogan
  • 5,341
  • 8
  • 32
  • 53
  • why do you want to obtain RPT for admin-cli? I think you should define a dedicated client for your application. – Rasha Elsayed May 22 '20 at 20:41
  • @RashaElsayed thanks, I have created a new client that care about user registration and I made it access_type : confidental, I think Keycloak Java Client only supports confidental access_type. – Muhammed Ozdogan May 23 '20 at 01:45

0 Answers0