com.stark.jarvis.security.oauth2.authentication.sms.PhoneUserDetailsServiceProvider Maven / Gradle / Ivy
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");
}
}
}