Java Code Examples for org.keycloak.representations.idm.ClientRepresentation#getSecret()

The following examples show how to use org.keycloak.representations.idm.ClientRepresentation#getSecret() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClientImportService.java    From keycloak-config-cli with Apache License 2.0 6 votes vote down vote up
private boolean isClientEqual(String realm, ClientRepresentation existingClient, ClientRepresentation patchedClient) {
    if (!CloneUtil.deepEquals(existingClient, patchedClient, "id", "secret", "access", "protocolMappers")) {
        return false;
    }

    if (!ProtocolMapperUtil.areProtocolMappersEqual(patchedClient.getProtocolMappers(), existingClient.getProtocolMappers())) {
        return false;
    }

    String patchedClientSecret = patchedClient.getSecret();
    if (patchedClientSecret == null) {
        return true;
    }

    String clientSecret = clientRepository.getClientSecret(realm, patchedClient.getClientId());
    return clientSecret.equals(patchedClientSecret);
}
 
Example 2
Source File: StripSecretsUtils.java    From keycloak with Apache License 2.0 4 votes vote down vote up
public static ClientRepresentation strip(ClientRepresentation rep) {
    if (rep.getSecret() != null) {
        rep.setSecret(maskNonVaultValue(rep.getSecret()));
    }
    return rep;
}