Package com.alpaca.security.oauth2
Class AccessTokenResConverter
java.lang.Object
com.alpaca.security.oauth2.AccessTokenResConverter
- All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<Map<String,
Object>, org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse>
public class AccessTokenResConverter
extends Object
implements org.springframework.core.convert.converter.Converter<Map<String,Object>,org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse>
Converter that transforms a raw token response
Map
into a structured OAuth2AccessTokenResponse
.
This converter handles standard OAuth2 token response entries:
- access_token: required access token string.
- token_type: assigned as Bearer by default.
- expires_in: duration in seconds (parsed via
Number.longValue()
), with default fallback when missing. - refresh_token: optional refresh token string.
- scope: parsed robustly from String or Collection inputs.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse
extractAdditionalParameters
(Map<String, Object> source) private long
parseExpiresIn
(Map<String, Object> source) parseScopes
(Map<String, Object> source) Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.core.convert.converter.Converter
andThen
-
Field Details
-
SCOPE_DELIMITER
-
DEFAULT_EXPIRES_IN
private static final long DEFAULT_EXPIRES_IN- See Also:
-
TOKEN_RESPONSE_PARAMETER_NAMES
-
-
Constructor Details
-
AccessTokenResConverter
public AccessTokenResConverter()
-
-
Method Details
-
convert
-
parseExpiresIn
-
parseScopes
-
extractAdditionalParameters
-