org.keycloak.services.resources

## Class AccountService

- java.lang.Object
- - org.keycloak.services.resources.AbstractSecuredLocalService
  - - org.keycloak.services.resources.AccountService

-     public class AccountService
      extends AbstractSecuredLocalService

  Author:
    Stian Thorgersen

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AccountService.AccountSocialAction`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ACCOUNT_MGMT_FORWARDED_ERROR_NOTE`

    - ### Fields inherited from class org.keycloak.services.resources.AbstractSecuredLocalService

      `auth, client, clientConnection, headers, realm, request, session, stateChecker, uriInfo`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AccountService(RealmModel realm, ClientModel client, EventBuilder event)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.ws.rs.core.Response` | `accountPage()` Get account information.
    `javax.ws.rs.core.Response` | `accountPreflight()` CORS preflight
    `static javax.ws.rs.core.UriBuilder` | `accountServiceApplicationPage(javax.ws.rs.core.UriInfo uriInfo)`
    `static javax.ws.rs.core.UriBuilder` | `accountServiceBaseUrl(javax.ws.rs.core.UriBuilder base)`
    `static javax.ws.rs.core.UriBuilder` | `accountServiceBaseUrl(javax.ws.rs.core.UriInfo uriInfo)`
    `javax.ws.rs.core.Response` | `applicationsPage()`
    `javax.ws.rs.core.Response` | `federatedIdentityPage()`
    `protected URI` | `getBaseRedirectUri()`
    `protected Set<String>` | `getValidPaths()`
    `void` | `init()`
    `static boolean` | `isPasswordSet(KeycloakSession session, RealmModel realm, UserModel user)`
    `static javax.ws.rs.core.UriBuilder` | `loginRedirectUrl(javax.ws.rs.core.UriBuilder base)`
    `javax.ws.rs.core.Response` | `logPage()`
    `javax.ws.rs.core.Response` | `passwordPage()`
    `static javax.ws.rs.core.UriBuilder` | `passwordUrl(javax.ws.rs.core.UriBuilder base)`
    `javax.ws.rs.core.Response` | `processAccountUpdate(javax.ws.rs.core.MultivaluedMap<String,String> formData)` Update account information.
    `javax.ws.rs.core.Response` | `processFederatedIdentityUpdate(String action, String providerId, String stateChecker)`
    `javax.ws.rs.core.Response` | `processPasswordUpdate(javax.ws.rs.core.MultivaluedMap<String,String> formData)` Update account password Form params: password - old password password-new pasword-confirm
    `javax.ws.rs.core.Response` | `processRevokeGrant(javax.ws.rs.core.MultivaluedMap<String,String> formData)`
    `javax.ws.rs.core.Response` | `processSessionsLogout(String stateChecker)`
    `javax.ws.rs.core.Response` | `processTotpRemove(String stateChecker)`
    `javax.ws.rs.core.Response` | `processTotpUpdate(javax.ws.rs.core.MultivaluedMap<String,String> formData)` Update the TOTP for this account.
    `void` | `require(String role)`
    `void` | `requireOneOf(String... roles)`
    `javax.ws.rs.core.Response` | `sessionsPage()`
    `protected void` | `setReferrerOnPage()`
    `javax.ws.rs.core.Response` | `totpPage()`
    `static javax.ws.rs.core.UriBuilder` | `totpUrl(javax.ws.rs.core.UriBuilder base)`

    - ### Methods inherited from class org.keycloak.services.resources.AbstractSecuredLocalService

      `authenticateBrowser, csrfCheck, csrfCheck, login, loginRedirect, updateCsrfChecks`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ACCOUNT_MGMT_FORWARDED_ERROR_NOTE

          public static final String ACCOUNT_MGMT_FORWARDED_ERROR_NOTE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AccountService

          public AccountService(RealmModel realm,
                                ClientModel client,
                                EventBuilder event)

  - ### Method Detail

    - #### init

          public void init()

    - #### accountServiceBaseUrl

          public static javax.ws.rs.core.UriBuilder accountServiceBaseUrl(javax.ws.rs.core.UriInfo uriInfo)

    - #### accountServiceApplicationPage

          public static javax.ws.rs.core.UriBuilder accountServiceApplicationPage(javax.ws.rs.core.UriInfo uriInfo)

    - #### accountServiceBaseUrl

          public static javax.ws.rs.core.UriBuilder accountServiceBaseUrl(javax.ws.rs.core.UriBuilder base)

    - #### getValidPaths

          protected Set<String> getValidPaths()

      Specified by:
        `getValidPaths` in class `AbstractSecuredLocalService`

    - #### setReferrerOnPage

          protected void setReferrerOnPage()

    - #### accountPreflight

          @Path(value="/")
           @OPTIONS
          public javax.ws.rs.core.Response accountPreflight()

      CORS preflight
      Returns:

    - #### accountPage

          @Path(value="/")
           @GET
          public javax.ws.rs.core.Response accountPage()

      Get account information.
      Returns:

    - #### totpUrl

          public static javax.ws.rs.core.UriBuilder totpUrl(javax.ws.rs.core.UriBuilder base)

    - #### totpPage

          @Path(value="totp")
           @GET
          public javax.ws.rs.core.Response totpPage()

    - #### passwordUrl

          public static javax.ws.rs.core.UriBuilder passwordUrl(javax.ws.rs.core.UriBuilder base)

    - #### passwordPage

          @Path(value="password")
           @GET
          public javax.ws.rs.core.Response passwordPage()

    - #### federatedIdentityPage

          @Path(value="identity")
           @GET
          public javax.ws.rs.core.Response federatedIdentityPage()

    - #### logPage

          @Path(value="log")
           @GET
          public javax.ws.rs.core.Response logPage()

    - #### sessionsPage

          @Path(value="sessions")
           @GET
          public javax.ws.rs.core.Response sessionsPage()

    - #### applicationsPage

          @Path(value="applications")
           @GET
          public javax.ws.rs.core.Response applicationsPage()

    - #### processAccountUpdate

          @Path(value="/")
           @POST
           @Consumes(value="application/x-www-form-urlencoded")
          public javax.ws.rs.core.Response processAccountUpdate(javax.ws.rs.core.MultivaluedMap<String,String> formData)

      Update account information. Form params: firstName lastName email
      Parameters:
        `formData` -
      Returns:

    - #### processTotpRemove

          @Path(value="totp-remove")
           @GET
          public javax.ws.rs.core.Response processTotpRemove(@QueryParam(value="stateChecker")
                                                                                              String stateChecker)

    - #### processSessionsLogout

          @Path(value="sessions-logout")
           @GET
          public javax.ws.rs.core.Response processSessionsLogout(@QueryParam(value="stateChecker")
                                                                                                      String stateChecker)

    - #### processRevokeGrant

          @Path(value="revoke-grant")
           @POST
          public javax.ws.rs.core.Response processRevokeGrant(javax.ws.rs.core.MultivaluedMap<String,String> formData)

    - #### processTotpUpdate

          @Path(value="totp")
           @POST
           @Consumes(value="application/x-www-form-urlencoded")
          public javax.ws.rs.core.Response processTotpUpdate(javax.ws.rs.core.MultivaluedMap<String,String> formData)

      Update the TOTP for this account. form parameters: totp - otp generated by authenticator totpSecret - totp secret to register
      Parameters:
        `formData` -
      Returns:

    - #### processPasswordUpdate

          @Path(value="password")
           @POST
           @Consumes(value="application/x-www-form-urlencoded")
          public javax.ws.rs.core.Response processPasswordUpdate(javax.ws.rs.core.MultivaluedMap<String,String> formData)

      Update account password Form params: password - old password password-new pasword-confirm
      Parameters:
        `formData` -
      Returns:

    - #### processFederatedIdentityUpdate

          @Path(value="federated-identity-update")
           @GET
          public javax.ws.rs.core.Response processFederatedIdentityUpdate(@QueryParam(value="action")
                                                                                                                         String action,
                                                                                                                         @QueryParam(value="provider_id")
                                                                                                                         String providerId,
                                                                                                                         @QueryParam(value="stateChecker")
                                                                                                                         String stateChecker)

    - #### loginRedirectUrl

          public static javax.ws.rs.core.UriBuilder loginRedirectUrl(javax.ws.rs.core.UriBuilder base)

    - #### getBaseRedirectUri

          protected URI getBaseRedirectUri()

      Specified by:
        `getBaseRedirectUri` in class `AbstractSecuredLocalService`

    - #### isPasswordSet

          public static boolean isPasswordSet(KeycloakSession session,
                                              RealmModel realm,
                                              UserModel user)

    - #### require

          public void require(String role)

    - #### requireOneOf

          public void requireOneOf(String... roles)

Copyright © 2016 JBoss by Red Hat. All rights reserved.