org.keycloak.models

## Interface OAuth2DeviceTokenStoreProvider

- All Superinterfaces:
    Provider
  All Known Implementing Classes:
    InfinispanOAuth2DeviceTokenStoreProvider

      public interface OAuth2DeviceTokenStoreProvider
      extends Provider

  Provides cache for OAuth2 Device Authorization Grant tokens.
  Author:
    Hiroyuki Wada

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `approve(RealmModel realm, String userCode, String userSessionId, Map<String,String> additionalParams)` Approve the given user code
    `boolean` | `deny(RealmModel realm, String userCode)` Deny the given user code
    `OAuth2DeviceCodeModel` | `getByDeviceCode(RealmModel realm, String deviceCode)` Get the model object by the given device code
    `OAuth2DeviceCodeModel` | `getByUserCode(RealmModel realm, String userCode)` Get the model object by the given user code
    `boolean` | `isPollingAllowed(OAuth2DeviceCodeModel deviceCode)` Check the device code is allowed to poll
    `void` | `put(OAuth2DeviceCodeModel deviceCode, OAuth2DeviceUserCodeModel userCode, int lifespanSeconds)` Stores the given device code and user code
    `boolean` | `removeDeviceCode(RealmModel realm, String deviceCode)` Remove the given device code
    `boolean` | `removeUserCode(RealmModel realm, String userCode)` Remove the given user code

    - ### Methods inherited from interface org.keycloak.provider.Provider

      `close`

- - ### Method Detail

    - #### put

          void put(OAuth2DeviceCodeModel deviceCode,
                   OAuth2DeviceUserCodeModel userCode,
                   int lifespanSeconds)

      Stores the given device code and user code
      Parameters:
        `deviceCode` -
        `userCode` -
        `lifespanSeconds` -

    - #### getByDeviceCode

          OAuth2DeviceCodeModel getByDeviceCode(RealmModel realm,
                                                String deviceCode)

      Get the model object by the given device code
      Parameters:
        `realm` -
        `deviceCode` -
      Returns:

    - #### isPollingAllowed

          boolean isPollingAllowed(OAuth2DeviceCodeModel deviceCode)

      Check the device code is allowed to poll
      Parameters:
        `deviceCode` -
      Returns:
        Return true if the given device code is allowed to poll

    - #### getByUserCode

          OAuth2DeviceCodeModel getByUserCode(RealmModel realm,
                                              String userCode)

      Get the model object by the given user code
      Parameters:
        `realm` -
        `userCode` -
      Returns:

    - #### approve

          boolean approve(RealmModel realm,
                          String userCode,
                          String userSessionId,
                          Map<String,String> additionalParams)

      Approve the given user code
      Parameters:
        `realm` -
        `userCode` -
        `userSessionId` -
      Returns:
        Return true if approving successful. If the code is already expired and cleared, it returns false.

    - #### deny

          boolean deny(RealmModel realm,
                       String userCode)

      Deny the given user code
      Parameters:
        `realm` -
        `userCode` -
      Returns:
        Return true if denying successful. If the code is already expired and cleared, it returns false.

    - #### removeDeviceCode

          boolean removeDeviceCode(RealmModel realm,
                                   String deviceCode)

      Remove the given device code
      Parameters:
        `realm` -
        `deviceCode` -
      Returns:
        Return true if removing successful. If the code is already expired and cleared, it returns false.

    - #### removeUserCode

          boolean removeUserCode(RealmModel realm,
                                 String userCode)

      Remove the given user code
      Parameters:
        `realm` -
        `userCode` -
      Returns:
        Return true if removing successful. If the code is already expired and cleared, it returns false.

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