All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.stark.jarvis.security.oauth2.authentication.sms.OAuth2SmsVerificationCodeAuthenticationConverter Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
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);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy