com.stark.jarvis.security.oauth2.authentication.sms.OAuth2SmsVerificationCodeAuthenticationConverter Maven / Gradle / Ivy
package com.stark.jarvis.security.oauth2.authentication.sms;
import com.stark.jarvis.security.oauth2.authentication.base.OAuth2ResourceOwnerBaseAuthenticationConverter;
import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.core.AuthorizationGrantType;
import org.springframework.stereotype.Component;
import java.util.Map;
import java.util.Set;
/**
* 短信认证转换器
*
* @author Ben
* @version 1.0.0
* @since 2024/7/20
*/
@Component
public class OAuth2SmsVerificationCodeAuthenticationConverter extends OAuth2ResourceOwnerBaseAuthenticationConverter {
@Override
public AuthorizationGrantType getGrantType() {
return new AuthorizationGrantType(OAuth2ParameterNamesExtended.GRANT_TYPE);
}
@Override
public OAuth2SmsVerificationCodeAuthenticationToken buildToken(Set requestedScopes, Authentication clientPrincipal, Map additionalParameters) {
return new OAuth2SmsVerificationCodeAuthenticationToken(requestedScopes, clientPrincipal, additionalParameters);
}
}