Class LinkedAccountsResource
java.lang.Object
org.keycloak.services.resources.account.LinkedAccountsResource
API for linking/unlinking social login accounts
- Author:
- Stan Silvert
-
Constructor Summary
ConstructorDescriptionLinkedAccountsResource
(KeycloakSession session, HttpRequest request, Auth auth, EventBuilder event, UserModel user) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Response
buildLinkedAccountURI
(String providerAlias, String redirectUri) Deprecated.getLinkedAccounts
(KeycloakSession session, RealmModel realm, UserModel user) Deprecated.jakarta.ws.rs.core.Response
linkedAccounts
(Boolean linked, String search, Integer firstResult, Integer maxResults) Returns the enabled identity providers the user is currently linked to, or those available for the user to link their account to.When thelinked
param istrue
, all providers currently linked to the user are returned in the form ofLinkedAccountRepresentation
objects, including those associated with organizations.jakarta.ws.rs.core.Response
removeLinkedAccount
(String providerAlias)
-
Constructor Details
-
LinkedAccountsResource
public LinkedAccountsResource(KeycloakSession session, HttpRequest request, Auth auth, EventBuilder event, UserModel user)
-
-
Method Details
-
linkedAccounts
@GET @Path("/") @Produces("application/json") public jakarta.ws.rs.core.Response linkedAccounts(@QueryParam("linked") Boolean linked, @QueryParam("search") String search, @QueryParam("first") Integer firstResult, @QueryParam("max") Integer maxResults) Returns the enabled identity providers the user is currently linked to, or those available for the user to link their account to.When thelinked
param istrue
, all providers currently linked to the user are returned in the form ofLinkedAccountRepresentation
objects, including those associated with organizations. When thelinked
param isfalse
, only the identity providers not linked to organizations (i.e. realm level providers) will be returned and be made available for linking.- Parameters:
linked
- aBoolean
indicating whether to return only the linked providers (true
) or only the providers available for linking (false
).search
- Filter to search specific providers by name. Search can be prefixed (name*), contains (*name*) or exact (\"name\"). Default prefixed.firstResult
- Pagination offset.maxResults
- Maximum results size.- Returns:
- a set of
LinkedAccountRepresentation
sorted by the {code guiOrder}.
-
getLinkedAccounts
@Deprecated public List<LinkedAccountRepresentation> getLinkedAccounts(KeycloakSession session, RealmModel realm, UserModel user) Deprecated. -
buildLinkedAccountURI
@GET @Path("/{providerAlias}") @Produces("application/json") @Deprecated public jakarta.ws.rs.core.Response buildLinkedAccountURI(@PathParam("providerAlias") String providerAlias, @QueryParam("redirectUri") String redirectUri) Deprecated. -
removeLinkedAccount
@DELETE @Path("/{providerAlias}") @Produces("application/json") public jakarta.ws.rs.core.Response removeLinkedAccount(@PathParam("providerAlias") String providerAlias)
-