From 9ea44e9a911c078380cce43b4fafcd976b7abab4 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Wed, 21 Jan 2015 14:51:14 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- spring-cloud.html | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/spring-cloud.html b/spring-cloud.html index 5bee322..423ff28 100644 --- a/spring-cloud.html +++ b/spring-cloud.html @@ -2885,6 +2885,35 @@ class Application extends ResourceServerConfigurerAdapter { } +
+

Customizing the JWT Token Converter

+
+

When a resource server accepts an access token as a JWT, it has to +convert it to an Authentication so that Spring Security can do its +access decisions. Different token providers might support JWT tokens +with different contents, so Spring OAuth2 has an abstraction for +converting the token into security domain objects +(AccessTokenConverter). You can modify the default behaviour easily +by providing a @Bean of type JwtAccessTokenConverterConfigurer, +e.g.

+
+
+
+
@Component
+public class JwtCustomization extends DefaultAccessTokenConverter implements
+        JwtAccessTokenConverterConfigurer {
+
+    @Override
+    public void configure(JwtAccessTokenConverter converter) {
+        converter.setAccessTokenConverter(this);
+    }
+
+    ... // implement custom AccessTokenConverter here
+
+}
+
+
+

Token Relay

@@ -3137,7 +3166,7 @@ service or the "resource" service if you have one).