Skip to content

Commit cf956c5

Browse files
committed
Resource Server Configurer
So far, this is a draft on what may be the Resource Server Configuration DSL. Feedback is welcome! Issue: spring-projects/spring-security#5226
1 parent f80dff8 commit cf956c5

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2002-2018 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springframework.security.config.annotation.web.configurers.oauth2.resourceserver;
17+
18+
import org.springframework.security.config.annotation.web.HttpSecurityBuilder;
19+
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
20+
import org.springframework.security.oauth2.core.OAuth2TokenVerifier;
21+
import org.springframework.security.oauth2.resourceserver.web.BearerTokenResolver;
22+
23+
public class OAuth2ResourceServerConfigurer<B extends HttpSecurityBuilder<B>> extends
24+
AbstractHttpConfigurer<OAuth2ResourceServerConfigurer<B>, B> {
25+
26+
public OAuth2ResourceServerConfigurer<B> bearerTokenResolver(BearerTokenResolver resolver) {
27+
return this;
28+
}
29+
30+
public OAuth2ResourceServerConfigurer<B> accessTokenVerifier(OAuth2TokenVerifier... verifiers) {
31+
return this;
32+
}
33+
34+
public JwtConfigurer jwt() {
35+
return null;
36+
}
37+
38+
public class JwtConfigurer {
39+
public JwtConfigurer jwkSetUrl(String location) {
40+
return this;
41+
}
42+
43+
public OAuth2ResourceServerConfigurer<B> and() {
44+
return OAuth2ResourceServerConfigurer.this;
45+
}
46+
}
47+
}

0 commit comments

Comments
 (0)