Class AccountCredentialResource
java.lang.Object
org.keycloak.services.resources.account.AccountCredentialResource
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAccountCredentialResource
(KeycloakSession session, UserModel user, Auth auth, EventBuilder event) -
Method Summary
Modifier and TypeMethodDescriptioncredentialTypes
(String type, Boolean userCredentials) Retrieve the stream of credentials available to the current logged in user.void
removeCredential
(String credentialId) Deprecated.It is recommended to delete credentials with the use of "delete_credential" kc_action.void
Update a user label of specified credential of current user
-
Field Details
-
TYPE
- See Also:
-
USER_CREDENTIALS
- See Also:
-
-
Constructor Details
-
AccountCredentialResource
public AccountCredentialResource(KeycloakSession session, UserModel user, Auth auth, EventBuilder event)
-
-
Method Details
-
credentialTypes
@GET @Produces("application/json") public Stream<AccountCredentialResource.CredentialContainer> credentialTypes(@QueryParam("type") String type, @QueryParam("user-credentials") Boolean userCredentials) Retrieve the stream of credentials available to the current logged in user. It will return only credentials of enabled types, which user can use to authenticate in some authentication flow.- Parameters:
type
- Allows to filter just single credential type, which will be specified as this parameter. If null, it will return all credential typesuserCredentials
- specifies if user credentials should be returned. If true, they will be returned in the "userCredentials" attribute of particular credential. Defaults to true.- Returns:
-
removeCredential
@Path("{credentialId}") @DELETE @Deprecated public void removeCredential(@PathParam("credentialId") String credentialId) Deprecated.It is recommended to delete credentials with the use of "delete_credential" kc_action. Action can be used for instance by adding parameter like "kc_action=delete_credential:123" to the login URL where 123 is ID of the credential to delete.Remove a credential of current user- Parameters:
credentialId
- ID of the credential, which will be removed
-
setLabel
@PUT @Consumes("application/json") @Path("{credentialId}/label") public void setLabel(@PathParam("credentialId") String credentialId, String userLabel) Update a user label of specified credential of current user- Parameters:
credentialId
- ID of the credential, which will be updateduserLabel
- new user label as JSON string
-