Package 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 Description DefaultOAuth2DeviceUserCodeProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
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 interfaceOAuth2DeviceUserCodeProvider
- 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 interfaceOAuth2DeviceUserCodeProvider
- 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 interfaceOAuth2DeviceUserCodeProvider
- Parameters:
userCode
- Inputted user code.- Returns:
-
-