Package com.alpaca.security.oauth2
Class AuthResponseTypeDeserializer
java.lang.Object
com.fasterxml.jackson.databind.JsonDeserializer<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationResponseType>
com.alpaca.security.oauth2.AuthResponseTypeDeserializer
- All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.NullValueProvider
public class AuthResponseTypeDeserializer
extends com.fasterxml.jackson.databind.JsonDeserializer<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationResponseType>
Custom Jackson deserializer for OAuth2 authorization response type values.
Spring Security's OAuth2AuthorizationResponseType represents the OAuth2 response_type
parameter, such as "code". Since JSON may contain this value in lowercase, this deserializer
ensures correct construction of the enum-like object by normalizing the input to uppercase before
instantiation using the string constructor.
By extending JsonDeserializer, this class can be registered with Jackson’s
ObjectMapper, allowing Spring Boot to use it automatically when deserializing OAuth2 response
types from JSON.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonDeserializer
com.fasterxml.jackson.databind.JsonDeserializer.None -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationResponseTypedeserialize(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ct) Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer
deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, supportsUpdate, unwrappingDeserializer
-
Constructor Details
-
AuthResponseTypeDeserializer
public AuthResponseTypeDeserializer()
-
-
Method Details
-
deserialize
public org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationResponseType deserialize(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ct) throws IOException - Specified by:
deserializein classcom.fasterxml.jackson.databind.JsonDeserializer<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationResponseType>- Throws:
IOException
-