org.keycloak.services.resources.account

## Class AccountFormService

- java.lang.Object
- - org.keycloak.services.resources.AbstractSecuredLocalService
  - - org.keycloak.services.resources.account.AccountFormService

-     public class AccountFormService
      extends AbstractSecuredLocalService

  Author:
    Stian Thorgersen

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AccountFormService(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.
    `static javax.ws.rs.core.UriBuilder` | `accountServiceApplicationPage(javax.ws.rs.core.UriInfo uriInfo)`
    `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()`
    `javax.ws.rs.core.Response` | `grantPermission(String resourceId, String action, String[] permissionId, String requester)`
    `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()` Update account information.
    `javax.ws.rs.core.Response` | `processFederatedIdentityUpdate()`
    `javax.ws.rs.core.Response` | `processPasswordUpdate()` Update account password
    `javax.ws.rs.core.Response` | `processResourceActions(String[] resourceIds, String action)`
    `javax.ws.rs.core.Response` | `processRevokeGrant()`
    `javax.ws.rs.core.Response` | `processSessionsLogout()`
    `javax.ws.rs.core.Response` | `processTotpUpdate()` Update the TOTP for this account.
    `javax.ws.rs.core.Response` | `resourceDetailPage(String resourceId)`
    `javax.ws.rs.core.Response` | `resourceDetailPageAfterGrant(String resourceId)`
    `javax.ws.rs.core.Response` | `resourceDetailPageAfterShare(String resourceId)`
    `javax.ws.rs.core.Response` | `resourcesPage(String resourceId)`
    `javax.ws.rs.core.Response` | `sessionsPage()`
    `javax.ws.rs.core.Response` | `shareResource(String resourceId, String[] userIds, String[] scopes)`
    `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

      `login, loginRedirect`

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

    - #### AccountFormService

          public AccountFormService(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)

    - #### getValidPaths

          protected Set<String> getValidPaths()

      Specified by:
        `getValidPaths` in class `AbstractSecuredLocalService`

    - #### accountPage

          @Path(value="/")
           @GET
           @Produces(value="text/html")
          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()

      Update account information.

      Form params:

      firstName lastName email

      Returns:

    - #### processSessionsLogout

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

    - #### processRevokeGrant

          @Path(value="applications")
           @POST
           @Consumes(value="application/x-www-form-urlencoded")
          public javax.ws.rs.core.Response processRevokeGrant()

    - #### processTotpUpdate

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

      Update the TOTP for this account.

      form parameters:

      totp - otp generated by authenticator totpSecret - totp secret to register

      Returns:

    - #### processPasswordUpdate

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

      Update account password

      Form params:

      password - old password password-new pasword-confirm

      Returns:

    - #### processFederatedIdentityUpdate

          @Path(value="identity")
           @POST
           @Consumes(value="application/x-www-form-urlencoded")
          public javax.ws.rs.core.Response processFederatedIdentityUpdate()

    - #### resourcesPage

          @Path(value="resource")
           @GET
          public javax.ws.rs.core.Response resourcesPage(@QueryParam(value="resource_id")
                                                                                       String resourceId)

    - #### resourceDetailPage

          @Path(value="resource/{resource_id}")
           @GET
          public javax.ws.rs.core.Response resourceDetailPage(@PathParam(value="resource_id")
                                                                                                          String resourceId)

    - #### resourceDetailPageAfterGrant

          @Path(value="resource/{resource_id}/grant")
           @GET
          public javax.ws.rs.core.Response resourceDetailPageAfterGrant(@PathParam(value="resource_id")
                                                                                                                          String resourceId)

    - #### grantPermission

          @Path(value="resource/{resource_id}/grant")
           @POST
          public javax.ws.rs.core.Response grantPermission(@PathParam(value="resource_id")
                                                                                                              String resourceId,
                                                                                                              @FormParam(value="action")
                                                                                                              String action,
                                                                                                              @FormParam(value="permission_id")
                                                                                                              String[] permissionId,
                                                                                                              @FormParam(value="requester")
                                                                                                              String requester)

    - #### resourceDetailPageAfterShare

          @Path(value="resource/{resource_id}/share")
           @GET
          public javax.ws.rs.core.Response resourceDetailPageAfterShare(@PathParam(value="resource_id")
                                                                                                                          String resourceId)

    - #### shareResource

          @Path(value="resource/{resource_id}/share")
           @POST
          public javax.ws.rs.core.Response shareResource(@PathParam(value="resource_id")
                                                                                                            String resourceId,
                                                                                                            @FormParam(value="user_id")
                                                                                                            String[] userIds,
                                                                                                            @FormParam(value="scope_id")
                                                                                                            String[] scopes)

    - #### processResourceActions

          @Path(value="resource")
           @POST
          public javax.ws.rs.core.Response processResourceActions(@FormParam(value="resource_id")
                                                                                                 String[] resourceIds,
                                                                                                 @FormParam(value="action")
                                                                                                 String action)

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

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