org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso Java Examples

The following examples show how to use org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NotEnableOauth2SsoCondition.java    From onetwo with Apache License 2.0 5 votes vote down vote up
@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!");
}