org.keycloak.services.resources

## Class AccountService

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

-     public class AccountService
      extends Object

  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
    --- | ---
    `protected javax.ws.rs.core.HttpHeaders` | `headers`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AccountService(RealmModel realm, ApplicationModel application, TokenManager tokenManager, SocialRequestManager socialRequestManager, Audit audit)`

  - ### Method Summary

    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` | `accountServiceBaseUrl(javax.ws.rs.core.UriBuilder base)`
    `static javax.ws.rs.core.UriBuilder` | `accountServiceBaseUrl(javax.ws.rs.core.UriInfo uriInfo)`
    `void` | `init()`
    `javax.ws.rs.core.Response` | `loginRedirect(String code, String state, String error, String path, String referrer, javax.ws.rs.core.HttpHeaders headers)`
    `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` | `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` | `processSessionsLogout()`
    `javax.ws.rs.core.Response` | `processSocialUpdate(String action, String providerId)`
    `javax.ws.rs.core.Response` | `processTotpRemove()`
    `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()`
    `javax.ws.rs.core.Response` | `socialPage()`
    `static javax.ws.rs.core.UriBuilder` | `socialUrl(javax.ws.rs.core.UriBuilder base)`
    `javax.ws.rs.core.Response` | `totpPage()`
    `static javax.ws.rs.core.UriBuilder` | `totpUrl(javax.ws.rs.core.UriBuilder base)`

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

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

- - ### Field Detail

    - #### headers

          @Context
          protected javax.ws.rs.core.HttpHeaders headers

  - ### Constructor Detail

    - #### AccountService

          public AccountService(RealmModel realm,
                        ApplicationModel application,
                        TokenManager tokenManager,
                        SocialRequestManager socialRequestManager,
                        Audit audit)

  - ### Method Detail

    - #### init

          public void init()

    - #### accountServiceBaseUrl

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

    - #### accountServiceBaseUrl

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

    - #### 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()

    - #### socialUrl

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

    - #### socialPage

          @Path(value="social")
          @GET
          public javax.ws.rs.core.Response socialPage()

    - #### logPage

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

    - #### sessionsPage

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

    - #### 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()

    - #### processSessionsLogout

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

    - #### 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:

    - #### processSocialUpdate

          @Path(value="social-update")
          @GET
          public javax.ws.rs.core.Response processSocialUpdate(@QueryParam(value="action")
                                                               String action,
                                                               @QueryParam(value="provider_id")
                                                               String providerId)

    - #### loginRedirectUrl

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

    - #### loginRedirect

          @Path(value="login-redirect")
          @GET
          public javax.ws.rs.core.Response loginRedirect(@QueryParam(value="code")
                                                         String code,
                                                         @QueryParam(value="state")
                                                         String state,
                                                         @QueryParam(value="error")
                                                         String error,
                                                         @QueryParam(value="path")
                                                         String path,
                                                         @QueryParam(value="referrer")
                                                         String referrer,
                                                         @Context
                                                         javax.ws.rs.core.HttpHeaders headers)

    - #### require

          public void require(String role)

    - #### requireOneOf

          public void requireOneOf(String... roles)

Copyright © 2014. All Rights Reserved.