org.keycloak.services.resources.account

## Class AccountRestService

- java.lang.Object
- - org.keycloak.services.resources.account.AccountRestService

-     public class AccountRestService
      extends Object

  Author:
    Stian Thorgersen

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ClientConnection` | `clientConnection`
    `protected javax.ws.rs.core.HttpHeaders` | `headers`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AccountRestService(KeycloakSession session, Auth auth, ClientModel client, EventBuilder event, AccountRestApiVersion version)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `UserRepresentation` | `account()` Get account information.
    `Stream<ClientRepresentation>` | `applications(String name)`
    `AccountCredentialResource` | `credentials()`
    `javax.ws.rs.core.Response` | `getConsent(String clientId)` Returns the consent for the client with the given client id.
    `javax.ws.rs.core.Response` | `grantConsent(String clientId, ConsentRepresentation consent)` Creates or updates the consent of the given, requested consent for the client with the given client id.
    `void` | `init()`
    `LinkedAccountsResource` | `linkedAccounts()`
    `ResourcesService` | `resources()`
    `javax.ws.rs.core.Response` | `revokeConsent(String clientId)` Deletes the consent for the client with the given client id.
    `SessionResource` | `sessions()` Get session information.
    `javax.ws.rs.core.Response` | `updateAccount(UserRepresentation rep)`
    `javax.ws.rs.core.Response` | `updateConsent(String clientId, ConsentRepresentation consent)` Creates or updates the consent of the given, requested consent for the client with the given client id.

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

    - #### clientConnection

          @Context
          protected ClientConnection clientConnection

  - ### Constructor Detail

    - #### AccountRestService

          public AccountRestService(KeycloakSession session,
                                    Auth auth,
                                    ClientModel client,
                                    EventBuilder event,
                                    AccountRestApiVersion version)

  - ### Method Detail

    - #### init

          public void init()

    - #### account

          @Path(value="/")
           @GET
           @Produces(value="application/json")
          public UserRepresentation account()

      Get account information.
      Returns:

    - #### updateAccount

          @Path(value="/")
           @POST
           @Consumes(value="application/json")
           @Produces(value="application/json")
          public javax.ws.rs.core.Response updateAccount(UserRepresentation rep)

    - #### sessions

          @Path(value="/sessions")
          public SessionResource sessions()

      Get session information.
      Returns:

    - #### credentials

          @Path(value="/credentials")
          public AccountCredentialResource credentials()

    - #### resources

          @Path(value="/resources")
          public ResourcesService resources()

    - #### getConsent

          @Path(value="/applications/{clientId}/consent")
           @GET
           @Produces(value="application/json")
          public javax.ws.rs.core.Response getConsent(@PathParam(value="clientId")
                                                                                                                                                 String clientId)

      Returns the consent for the client with the given client id.
      Parameters:
        `clientId` - client id to return the consent for
      Returns:
        consent of the client

    - #### revokeConsent

          @Path(value="/applications/{clientId}/consent")
           @DELETE
          public javax.ws.rs.core.Response revokeConsent(@PathParam(value="clientId")
                                                                                                                  String clientId)

      Deletes the consent for the client with the given client id.
      Parameters:
        `clientId` - client id to delete a consent for
      Returns:
        returns 202 if deleted

    - #### grantConsent

          @Path(value="/applications/{clientId}/consent")
           @POST
           @Produces(value="application/json")
          public javax.ws.rs.core.Response grantConsent(@PathParam(value="clientId")
                                                                                                                                                    String clientId,
                                                                                                                                                    ConsentRepresentation consent)

      Creates or updates the consent of the given, requested consent for the client with the given client id. Returns the appropriate REST response.
      Parameters:
        `clientId` - client id to set a consent for
        `consent` - requested consent for the client
      Returns:
        the created or updated consent

    - #### updateConsent

          @Path(value="/applications/{clientId}/consent")
           @PUT
           @Produces(value="application/json")
          public javax.ws.rs.core.Response updateConsent(@PathParam(value="clientId")
                                                                                                                                                    String clientId,
                                                                                                                                                    ConsentRepresentation consent)

      Creates or updates the consent of the given, requested consent for the client with the given client id. Returns the appropriate REST response.
      Parameters:
        `clientId` - client id to set a consent for
        `consent` - requested consent for the client
      Returns:
        the created or updated consent

    - #### linkedAccounts

          @Path(value="/linked-accounts")
          public LinkedAccountsResource linkedAccounts()

    - #### applications

          @Path(value="/applications")
           @GET
           @Produces(value="application/json")
          public Stream<ClientRepresentation> applications(@QueryParam(value="name")
                                                                                                                                   String name)

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