org.springframework.boot.autoconfigure.security.oauth2.resource.AuthoritiesExtractor Java Examples

The following examples show how to use org.springframework.boot.autoconfigure.security.oauth2.resource.AuthoritiesExtractor. 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: SecurityConfig.java    From spring-boot-samples with Apache License 2.0 5 votes vote down vote up
@Bean
public AuthoritiesExtractor authoritiesExtractor() {
	return map -> {
		String username = (String) map.get("login");
		if (this.cfpProperties.getSecurity().getAdmins().contains(username)) {
			return AuthorityUtils.commaSeparatedStringToAuthorityList("ROLE_USER,ROLE_ADMIN");
		}
		else {
			return AuthorityUtils.commaSeparatedStringToAuthorityList("ROLE_USER");
		}
	};
}
 
Example #2
Source File: OAuth2SecurityConfiguration.java    From flair-registry with Apache License 2.0 4 votes vote down vote up
@Bean
public AuthoritiesExtractor authoritiesExtractor() {
    return new SimpleAuthoritiesExtractor(OAUTH2_AUTHORITIES_ATTRIBUTE);
}
 
Example #3
Source File: OAuth2TokenServicesConfiguration.java    From okta-jhipster-microservices-oauth-example with Apache License 2.0 4 votes vote down vote up
@Bean
public AuthoritiesExtractor authoritiesExtractor() {
    return new SimpleAuthoritiesExtractor(OAUTH2_AUTHORITIES_ATTRIBUTE);
}
 
Example #4
Source File: OAuth2TokenServicesConfiguration.java    From okta-jhipster-microservices-oauth-example with Apache License 2.0 4 votes vote down vote up
@Bean
public AuthoritiesExtractor authoritiesExtractor() {
    return new SimpleAuthoritiesExtractor(OAUTH2_AUTHORITIES_ATTRIBUTE);
}
 
Example #5
Source File: OAuth2TokenServicesConfiguration.java    From okta-jhipster-microservices-oauth-example with Apache License 2.0 4 votes vote down vote up
@Bean
public AuthoritiesExtractor authoritiesExtractor() {
    return new SimpleAuthoritiesExtractor(OAUTH2_AUTHORITIES_ATTRIBUTE);
}
 
Example #6
Source File: MyUserInfoTokenServices.java    From springboot-security-wechat with Apache License 2.0 4 votes vote down vote up
public void setAuthoritiesExtractor(AuthoritiesExtractor authoritiesExtractor) {
    Assert.notNull(authoritiesExtractor, "AuthoritiesExtractor must not be null");
    this.authoritiesExtractor = authoritiesExtractor;
}
 
Example #7
Source File: CustomUserInfoTokenServices.java    From DAFramework with MIT License 4 votes vote down vote up
public void setAuthoritiesExtractor(AuthoritiesExtractor authoritiesExtractor) {
	this.authoritiesExtractor = authoritiesExtractor;
}
 
Example #8
Source File: CustomUserInfoTokenServices.java    From microservice-skeleton with MIT License 4 votes vote down vote up
public void setAuthoritiesExtractor(AuthoritiesExtractor authoritiesExtractor) {
    this.authoritiesExtractor = authoritiesExtractor;
}
 
Example #9
Source File: SecurityConfig.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
@Profile("oauth2-extractors-baeldung")
public AuthoritiesExtractor baeldungAuthoritiesExtractor() {
    return new BaeldungAuthoritiesExtractor();
}
 
Example #10
Source File: SecurityConfig.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
@Profile("oauth2-extractors-github")
public AuthoritiesExtractor githubAuthoritiesExtractor() {
    return new GithubAuthoritiesExtractor();
}