Merge Formatting Changes
Issue gh-8945
This commit is contained in:
@@ -896,9 +896,9 @@ fun jwtDecoder(): ReactiveJwtDecoder {
|
||||
|
||||
[[webflux-oauth2resourceserver-opaque-minimaldependencies]]
|
||||
=== Minimal Dependencies for Introspection
|
||||
As described in <<oauth2resourceserver-jwt-minimaldependencies,Minimal Dependencies for JWT>> most of Resource Server support is collected in `spring-security-oauth2-resource-server`.
|
||||
However unless a custom <<webflux-oauth2resourceserver-opaque-introspector-bean,`ReactiveOpaqueTokenIntrospector`>> is provided, the Resource Server will fallback to ReactiveOpaqueTokenIntrospector.
|
||||
Meaning that both `spring-security-oauth2-resource-server` and `oauth2-oidc-sdk` are necessary in order to have a working minimal Resource Server that supports opaque Bearer Tokens.
|
||||
As described in <<oauth2resourceserver-jwt-minimaldependencies,Minimal Dependencies for JWT>> most of Resource Server support is collected in `spring-security-oauth2-resource-server`.
|
||||
However unless a custom <<webflux-oauth2resourceserver-opaque-introspector-bean,`ReactiveOpaqueTokenIntrospector`>> is provided, the Resource Server will fallback to ReactiveOpaqueTokenIntrospector.
|
||||
Meaning that both `spring-security-oauth2-resource-server` and `oauth2-oidc-sdk` are necessary in order to have a working minimal Resource Server that supports opaque Bearer Tokens.
|
||||
Please refer to `spring-security-oauth2-resource-server` in order to determin the correct version for `oauth2-oidc-sdk`.
|
||||
|
||||
[[webflux-oauth2resourceserver-opaque-minimalconfiguration]]
|
||||
@@ -1486,8 +1486,8 @@ public class JwtOpaqueTokenIntrospector implements ReactiveOpaqueTokenIntrospect
|
||||
public Mono<JWTClaimsSet> convert(JWT jwt) {
|
||||
try {
|
||||
return Mono.just(jwt.getJWTClaimsSet());
|
||||
} catch (Exception e) {
|
||||
return Mono.error(e);
|
||||
} catch (Exception ex) {
|
||||
return Mono.error(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -36,8 +36,8 @@ The pseudocode for `ExceptionTranslationFilter` looks something like this:
|
||||
----
|
||||
try {
|
||||
filterChain.doFilter(request, response); // <1>
|
||||
} catch (AccessDeniedException | AuthenticationException e) {
|
||||
if (!authenticated || e instanceof AuthenticationException) {
|
||||
} catch (AccessDeniedException | AuthenticationException ex) {
|
||||
if (!authenticated || ex instanceof AuthenticationException) {
|
||||
startAuthentication(); // <2>
|
||||
} else {
|
||||
accessDenied(); // <3>
|
||||
|
||||
@@ -75,7 +75,7 @@ For example, the following would attempt to authenticate with the username "user
|
||||
----
|
||||
try {
|
||||
httpServletRequest.login("user","password");
|
||||
} catch(ServletException e) {
|
||||
} catch(ServletException ex) {
|
||||
// fail to authenticate
|
||||
}
|
||||
----
|
||||
@@ -111,8 +111,8 @@ async.start(new Runnable() {
|
||||
asyncResponse.setStatus(HttpServletResponse.SC_OK);
|
||||
asyncResponse.getWriter().write(String.valueOf(authentication));
|
||||
async.complete();
|
||||
} catch(Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch(Exception ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -174,8 +174,8 @@ new Thread("AsyncThread") {
|
||||
|
||||
// Write to and commit the httpServletResponse
|
||||
httpServletResponse.getOutputStream().flush();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
|
||||
@@ -1055,9 +1055,9 @@ To do so, remember that `NimbusJwtDecoder` ships with a constructor that takes N
|
||||
|
||||
[[oauth2resourceserver-opaque-minimaldependencies]]
|
||||
=== Minimal Dependencies for Introspection
|
||||
As described in <<oauth2resourceserver-jwt-minimaldependencies,Minimal Dependencies for JWT>> most of Resource Server support is collected in `spring-security-oauth2-resource-server`.
|
||||
However unless a custom <<oauth2resourceserver-opaque-introspector,`OpaqueTokenIntrospector`>> is provided, the Resource Server will fallback to NimbusOpaqueTokenIntrospector.
|
||||
Meaning that both `spring-security-oauth2-resource-server` and `oauth2-oidc-sdk` are necessary in order to have a working minimal Resource Server that supports opaque Bearer Tokens.
|
||||
As described in <<oauth2resourceserver-jwt-minimaldependencies,Minimal Dependencies for JWT>> most of Resource Server support is collected in `spring-security-oauth2-resource-server`.
|
||||
However unless a custom <<oauth2resourceserver-opaque-introspector,`OpaqueTokenIntrospector`>> is provided, the Resource Server will fallback to NimbusOpaqueTokenIntrospector.
|
||||
Meaning that both `spring-security-oauth2-resource-server` and `oauth2-oidc-sdk` are necessary in order to have a working minimal Resource Server that supports opaque Bearer Tokens.
|
||||
Please refer to `spring-security-oauth2-resource-server` in order to determin the correct version for `oauth2-oidc-sdk`.
|
||||
|
||||
[[oauth2resourceserver-opaque-minimalconfiguration]]
|
||||
@@ -1626,8 +1626,8 @@ public class JwtOpaqueTokenIntrospector implements OpaqueTokenIntrospector {
|
||||
try {
|
||||
Jwt jwt = this.jwtDecoder.decode(token);
|
||||
return new DefaultOAuth2AuthenticatedPrincipal(jwt.getClaims(), NO_AUTHORITIES);
|
||||
} catch (JwtException e) {
|
||||
throw new OAuth2IntrospectionException(e);
|
||||
} catch (JwtException ex) {
|
||||
throw new OAuth2IntrospectionException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1899,8 +1899,8 @@ public class TenantJWSKeySelector
|
||||
private JWSKeySelector<SecurityContext> fromUri(String uri) {
|
||||
try {
|
||||
return JWSAlgorithmFamilyJWSKeySelector.fromJWKSetURL(new URL(uri)); <4>
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
} catch (Exception ex) {
|
||||
throw new IllegalArgumentException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user