下面列出了怎么用org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso的API类实例代码及写法,或者点击链接到github查看源代码。
@Override
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {
String ssoClass = "org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso";
boolean ssoClientAnnotationExists = ClassUtils.isPresent(ssoClass, null);
if(!ssoClientAnnotationExists){
return ConditionOutcome.match("EnableOAuth2Sso not exists!");
}
String[] beanNames = context.getBeanFactory().getBeanNamesForAnnotation(EnableOAuth2Sso.class);
if(beanNames==null || beanNames.length==0){
return ConditionOutcome.match("not @EnableOAuth2Sso bean found!");
}
return ConditionOutcome.noMatch("@EnableOAuth2Sso sso client!");
}