Package org.keycloak.models
Interface CodeToTokenStoreProvider
-
- All Superinterfaces:
Provider
- All Known Implementing Classes:
InfinispanCodeToTokenStoreProvider
public interface CodeToTokenStoreProvider extends Provider
Provides single-use cache for OAuth2 code parameter. Used to ensure that particular value of code parameter is used once. For now, it is separate provider as it's a bit different use-case thanActionTokenStoreProvider
, however it may reuse some components (eg. same infinispan cache)- Author:
- Marek Posolda
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
put(UUID codeId, int lifespanSeconds, Map<String,String> codeData)
Stores the given data and guarantees that data should be available in the store for at least the time specified by {@param lifespanSeconds} parameterMap<String,String>
remove(UUID codeId)
This method returns data just if removal was successful.
-
-
-
Method Detail
-
put
void put(UUID codeId, int lifespanSeconds, Map<String,String> codeData)
Stores the given data and guarantees that data should be available in the store for at least the time specified by {@param lifespanSeconds} parameter- Parameters:
codeId
-lifespanSeconds
-codeData
-
-
remove
Map<String,String> remove(UUID codeId)
This method returns data just if removal was successful. Implementation should guarantee that "remove" is single-use. So if 2 threads (even on different cluster nodes or on different cross-dc nodes) calls "remove(123)" concurrently, then just one of them is allowed to succeed and return data back. It can't happen that both will succeed.- Parameters:
codeId
-- Returns:
- context data related to OAuth2 code. It returns null if there are not context data available.
-
-