org.keycloak.models

## Class DefaultOAuth2DeviceUserCodeProvider

- java.lang.Object
- - org.keycloak.models.DefaultOAuth2DeviceUserCodeProvider

- All Implemented Interfaces:
    OAuth2DeviceUserCodeProvider, Provider

      public class DefaultOAuth2DeviceUserCodeProvider
      extends Object
      implements OAuth2DeviceUserCodeProvider

  The default implementation for generating/formatting user code of OAuth 2.0 Device Authorization Grant. For generation, uppercase eight-letter format is used. For display, uppercase four-letters dashes four-letters format is used.
  Author:
    Hiroyuki Wada

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultOAuth2DeviceUserCodeProvider()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `String` | `display(String userCode)` Get human-readability user code from original user code.
    `String` | `format(String userCode)` Format inputted user code.
    `String` | `generate()` Generate a new user code for OAuth 2.0 Device Authorization Grant.

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

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

- - ### Constructor Detail

    - #### DefaultOAuth2DeviceUserCodeProvider

          public DefaultOAuth2DeviceUserCodeProvider()

  - ### Method Detail

    - #### generate

          public String generate()

      Description copied from interface: `OAuth2DeviceUserCodeProvider`
      Generate a new user code for OAuth 2.0 Device Authorization Grant.
      Specified by:
        `generate` in interface `OAuth2DeviceUserCodeProvider`
      Returns:
        Return a generated user code

    - #### display

          public String display(String userCode)

      Description copied from interface: `OAuth2DeviceUserCodeProvider`
      Get human-readability user code from original user code.
      Specified by:
        `display` in interface `OAuth2DeviceUserCodeProvider`
      Parameters:
        `userCode` - Original user code
      Returns:
        Return a human-readability user code

    - #### format

          public String format(String userCode)

      Description copied from interface: `OAuth2DeviceUserCodeProvider`
      Format inputted user code.
      Specified by:
        `format` in interface `OAuth2DeviceUserCodeProvider`
      Parameters:
        `userCode` - Inputted user code.
      Returns:

    - #### close

          public void close()

      Specified by:
        `close` in interface `Provider`

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