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

com.stark.jarvis.security.oauth2.authentication.sms.PhoneUserDetailsServiceProvider 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.core.UserDetailsServiceProvider;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 根据手机号码查询用户
 *
 * @author Ben
 * @version 1.0.0
 * @since 2024/7/21
 */
public interface PhoneUserDetailsServiceProvider extends UserDetailsServiceProvider {

    @Override
    default boolean supports(String grantType) {
        return OAuth2ParameterNamesExtended.GRANT_TYPE.equals(grantType);
    }

    @Configuration
    class PhoneUserDetailsServiceProviderConfig {

        @Bean
        @ConditionalOnMissingBean
        public PhoneUserDetailsServiceProvider phoneUserDetailsServiceProvider() {
            throw new RuntimeException("PhoneUserDetailsServiceProvider implementation required");
        }

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy