File tree
Expand file treeCollapse file tree2 files changed
+3
-7
lines changed java/se/curity/examples/spark
Expand file treeCollapse file tree2 files changed
+3
-7
lines changed Original file line number | Diff line number | Diff line change |
---|
|
33 | 33 |
|
34 | 34 | public class SparkServerExample implements SparkApplication
|
35 | 35 | {
|
36 |
| - |
37 |
| -private static final Logger _logger = LoggerFactory.getLogger(SparkServerExample.class); |
38 |
| - |
39 | 36 | @Override
|
40 | 37 | public void init()
|
41 | 38 | {
|
42 |
| -_logger.debug("Initializing OAuth protected API"); |
43 | 39 | get("/hello_world", (req, res) ->{
|
44 | 40 | AuthenticatedUser user = (AuthenticatedUser)req.attribute(OAuthFilter.PRINCIPAL);
|
45 | 41 | return "Hello "+ user.getSubject() + " from an OAuth protected world!";
|
@@ -49,7 +45,7 @@ public void init()
|
49 | 45 | private void initStandalone() throws ServletException
|
50 | 46 | {
|
51 | 47 | init();
|
52 |
| -OAuthFilter filter = getOpaqueFilter(); |
| 48 | +OAuthFilter filter = getJwtFilter(); |
53 | 49 | before(((request, response) -> {
|
54 | 50 | filter.doFilter(request.raw(), response.raw(), null);
|
55 | 51 | if(response.raw().isCommitted())
|
@@ -69,7 +65,7 @@ private OAuthFilter getJwtFilter() throws ServletException
|
69 | 65 | {
|
70 | 66 | EmbeddedSparkJwtFilterConfig filterParams = new EmbeddedSparkJwtFilterConfig("localhost",
|
71 | 67 | "8443",
|
72 |
| -"/oauth/v2/metadata/jwks", |
| 68 | +"/oauth/v2/oauth-anonymous/jwks", |
73 | 69 | "read",
|
74 | 70 | "3600");
|
75 | 71 | OAuthFilter filter = new OAuthJwtFilter();
|
|
Original file line number | Diff line number | Diff line change |
---|
|
43 | 43 | </init-param>
|
44 | 44 | <init-param>
|
45 | 45 | <param-name>jsonWebKeysPath</param-name>
|
46 |
| -<param-value>/oauth/v2/metadata/jwks</param-value> |
| 46 | +<param-value>/oauth/v2/oauth-anonymous/jwks</param-value> |
47 | 47 | </init-param>
|
48 | 48 | <init-param>
|
49 | 49 | <param-name>scope</param-name>
|
|
You can’t perform that action at this time.
0 commit comments