Java Code Examples for org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer#resourceId()

The following examples show how to use org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer#resourceId() . 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: ResourceServerConfiguration.java    From onetwo with Apache License 2.0 6 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
	if(tokenStore!=null){
		resources.tokenStore(tokenStore);
	}
	String resourceId = oauth2Properties.getResourceServer().getResourceId();
	if(resourceId!=null){
		resources.resourceId(resourceId);//see OAuth2AuthenticationProcessingFilter#doFilter -> OAuth2AuthenticationManager#authenticate
	}
	if(oauth2AuthenticationEntryPoint!=null){
		resources.authenticationEntryPoint(oauth2AuthenticationEntryPoint);
	}
	if(oauth2AccessDeniedHandler!=null){
		resources.accessDeniedHandler(oauth2AccessDeniedHandler);
	}
}
 
Example 2
Source File: OauthConfig.java    From entref-spring-boot with MIT License 5 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
    // setup the resource id
    resources.resourceId(this.env.getProperty(Constants.ENV_OAUTH_RES_ID));

    // setup the token store
    resources.tokenStore(new JwkTokenStore(this.env.getProperty(Constants.ENV_OAUTH_KEYSET_URI)));
}
 
Example 3
Source File: OAuth2ServerConfiguration.java    From spring-rest-service-oauth with Apache License 2.0 5 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) {
	// @formatter:off
	resources
		.resourceId(RESOURCE_ID);
	// @formatter:on
}
 
Example 4
Source File: SecurityConfigurer.java    From spring-oauth2-keycloak-connector with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
  resources.resourceId(resourceServerProperties.getResourceId());
}
 
Example 5
Source File: ResourceServerConfig.java    From java8-spring-cloud-microservice-demo with MIT License 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer config) {
    config.resourceId("default-resources"); // this matches the resourceId in OAuth2JwtConfig
    config.tokenServices(this.getTokenService());
}
 
Example 6
Source File: ResourceServer.java    From konker-platform with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) {
	resources.resourceId(RESOURCE_ID);
}
 
Example 7
Source File: OAuth2ResourceServerConfiguration.java    From omh-dsu-ri with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) {
    resources.resourceId(OAuth2Properties.DATA_POINT_RESOURCE_ID);
}
 
Example 8
Source File: ResourceServerConfig.java    From springboot-vue.js-bbs with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer config) {
    config.resourceId(resourceId);
}
 
Example 9
Source File: ResourceB.java    From OAuth-2.0-Cookbook with MIT License 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
    resources.resourceId("resource-b");
}
 
Example 10
Source File: ResourceServerConfig.java    From auth-server with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) {
  resources.resourceId(null);
}
 
Example 11
Source File: ResourceServerConfiguration.java    From spring-glee-o-meter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) {
    resources.resourceId("api");
}
 
Example 12
Source File: ApiBootResourceServerAutoConfiguration.java    From beihu-boot with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
    resources.resourceId(apiBootOauthProperties.getResourceId());
}
 
Example 13
Source File: ApiBootResourceServerAutoConfiguration.java    From api-boot with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
    resources.resourceId(apiBootOauthProperties.getResourceId());
}
 
Example 14
Source File: Oauth2ResourceServerConfig.java    From spring-security-oauth2-demo with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
    // 设置资源服务器的 id,从配置文件中读取
    resources.resourceId(resourceServerProperties.getResourceId());
}
 
Example 15
Source File: Oauth2ResourceServerConfig.java    From spring-security-oauth2-demo with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
    // 设置资源服务器的 id
    resources.resourceId("oauth2");
}
 
Example 16
Source File: SecurityConfig.java    From resource-server-testing with MIT License 4 votes vote down vote up
@Override
public void configure(final ResourceServerSecurityConfigurer resources) {
	resources.resourceId("myresource");
}
 
Example 17
Source File: ResourceServerConfiguration.java    From demo-spring-boot-security-oauth2 with MIT License 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) {
    // @formatter:off
    resources.resourceId(resourceId);
    // @formatter:on
}
 
Example 18
Source File: ResourceServerConfig.java    From multi-tenant-rest-api with MIT License 3 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources)
		throws Exception {

	resources.resourceId("resource");
	
}
 
Example 19
Source File: ResourceServerConfiguration.java    From spring-boot-microservices with Apache License 2.0 2 votes vote down vote up
/**
* Id of the resource that you are letting the client have access to.
* Supposing you have another api ("say api2"), then you can customize the
* access within resource server to define what api is for what resource id.
* <br>
* <br>
* 
* So suppose you have 2 APIs, then you can define 2 resource servers.
* <ol>
* <li>Client 1 has been configured for access to resourceid1, so he can
* only access "api1" if the resource server configures the resourceid to
* "api1".</li>
* <li>Client 1 can't access resource server 2 since it has configured the
* resource id to "api2"
* </li>
* </ol>
* 
*/
  @Override
  public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
       resources.resourceId("apis");
  }
 
Example 20
Source File: TaskConfiguration.java    From spring-boot-microservices with Apache License 2.0 2 votes vote down vote up
/**
* Id of the resource that you are letting the client have access to.
* Supposing you have another api ("say api2"), then you can customize the
* access within resource server to define what api is for what resource id.
* <br>
* <br>
* 
* So suppose you have 2 APIs, then you can define 2 resource servers.
* <ol>
* <li>Client 1 has been configured for access to resourceid1, so he can
* only access "api1" if the resource server configures the resourceid to
* "api1".</li>
* <li>Client 1 can't access resource server 2 since it has configured the
* resource id to "api2"
* </li>
* </ol>
* 
*/
  @Override
  public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
       resources.resourceId("apis");
  }