Package org.keycloak.models
Interface OAuth2DeviceTokenStoreProvider
-
- All Superinterfaces:
Provider
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 Description booleanapprove(RealmModel realm, String userCode, String userSessionId, Map<String,String> additionalParams)Approve the given user codebooleandeny(RealmModel realm, String userCode)Deny the given user codeOAuth2DeviceCodeModelgetByDeviceCode(RealmModel realm, String deviceCode)Get the model object by the given device codeOAuth2DeviceCodeModelgetByUserCode(RealmModel realm, String userCode)Get the model object by the given user codebooleanisPollingAllowed(OAuth2DeviceCodeModel deviceCode)Check the device code is allowed to pollvoidput(OAuth2DeviceCodeModel deviceCode, OAuth2DeviceUserCodeModel userCode, int lifespanSeconds)Stores the given device code and user codebooleanremoveDeviceCode(RealmModel realm, String deviceCode)Remove the given device codebooleanremoveUserCode(RealmModel realm, String userCode)Remove the given user code
-
-
-
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.
-
-