[keycloak-user] Not able to retrieve password from using keycloak admin api

Prince Anand Anandaraj princeanand.anandaraj at object-frontier.com
Mon Sep 17 12:07:27 EDT 2018


Hi,

     I am pretty new to keycloak and currently working on to secure an 
application using keycloak. Currently, I am using keycloak version 3.4.3.


     I am trying to retrieve password of a user using the keycloak admin api 
in java. 

     keycloak = 
Keycloak.getInstance(keyCloakProperties.getProperty("keycloak.baseURL"), 
                keyCloakProperties.getProperty("keycloak.loginRealm"),
                keyCloakProperties.getProperty("keycloak.loginId"),
                keyCloakProperties.getProperty("keycloak.loginPwd"),
                keyCloakProperties.getProperty("keycloak.clientId"),
                keyCloakProperties.getProperty("keycloak.secretKey"));

     realmResource = 
keycloak.realm(keyCloakProperties.getProperty("keycloak.userRealm"));    
     realmResource.users().get(userId).toRepresentation().getCredentials();

     The last line of code suppose to return a list with type 
<CredentialRepresentation> but I get only null. Am I missing something.

     Did anyone else face this issue.. If yes please help!!


Thanks in advance..

Thanks and regards,
Prince Anand

Disclaimer : http://www.objectfrontier.com/maildisclaimer.html


Disclaimer : http://www.objectfrontier.com/maildisclaimer.html


More information about the keycloak-user mailing list