$ curl https://uaa.run.pivotal.io/token_key
{"alg":"SHA256withRSA","value":"-----BEGIN PUBLIC KEY-----\nMIIBI...\n-----END PUBLIC KEY-----\n"}
diff --git a/spring-cloud.html b/spring-cloud.html index 0422d3b..be13dab 100644 --- a/spring-cloud.html +++ b/spring-cloud.html @@ -523,6 +523,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
Environment:
oauth2.client.* with * equal to clientId, clientSecret,
-tokenUri, authorizationUri and one of:
accessTokenUri, userAuthorizationUri and one of:
+oauth2.resource.preferTokenInfo=false and
-oauth2.resource.userInfoUri to use the "/me" resource
+
oauth2.resource.userInfoUri to use the "/me" resource
(e.g. "https://uaa.run.pivotal.io/userinfo" on PWS), or
oauth2.resource.tokenInfoUri to use the token decoding endpoint
-(e.g. "https://uaa.run.pivotal.io/check_token" on PWS), or
If you specify both the userInfoUri and the tokenInfoUri then
+you can set a flag to say that one is preferred over the other
+(preferTokenInfo=true is the default). Or
oauth2.resource.jwt.keyValue or oauth2.resource.jwt.keyUri to
+
oauth2.resource.jwt.keyValue to
decode a JWT token locally, where the key is a verification key. The
verification key value is either a symmetric secret or PEM-encoded
RSA public key. If you don’t have the key and it’s public you can
provide a URI where it can be downloaded (as a JSON object with a
-"value" field). E.g. on PWS:
-+
oauth2.resource.jwt.keyUri. E.g. on PWS:
$ curl https://uaa.run.pivotal.io/token_key
{"alg":"SHA256withRSA","value":"-----BEGIN PUBLIC KEY-----\nMIIBI...\n-----END PUBLIC KEY-----\n"}
|
+ Warning
+ |
+
+If you use the oauth2.resource.jwt.keyUri the authorization
+server needs to be running when your application starts up. It will
+log a warning if it can’t find the key, and tell you what to do to fix
+it.
+ |
+
You can set the preferred scope (as a comma-separated list or YAML
array) in oauth2.client.scope. It defaults to empty, in which case
@@ -2690,10 +2713,38 @@ most Authorization Servers will ask the user for approval for the
maximum allowed scope for the client.
There is also a setting for oauth2.client.authenticationScheme which
+
There is also a setting for oauth2.client.clientAuthenticationScheme which
defaults to "header" (but you might need to set it to "form" if, like
Github for instance, your OAuth2 provider doesn’t like header
-authentication).
oauth2.client.* properties are bound to an instance
+of AuthorizationCodeResourceDetails so all its properties can be specified.
+|
+ Tip
+ |
+
+
+
+To set an RSA key value in YAML use the "pipe" continuation +marker to split it over multiple lines ("|") and remember to indent +the key value (it’s a standard YAML language feature). Example: +
+
+
+
+
+ |
+
OAuth2SsoConfigurer beans as well. The default logout path is
"/logout" and it gets similar treatment, as does the "home" page
(which is the logout success page, defaults to "/"). Those paths can
-be overriden by setting oauth2.sso.\*' (`loginPath, logoutPath and
+be overriden by setting oauth2.sso.*' (`loginPath, logoutPath and
home.path).
clientId and clientSecret if it i
tokenInfoUri (i.e. if it has jwt.* or userInfoUri).
By default all your endpoints are protected (i.e. "/") but you can
+ By default all your endpoints are protected (i.e. "/**") but you can
pick and choose by adding a ResourceServerConfigurerAdapter (standard
-Spring OAuth feature), e.g. to protect only the "/api/
@EnableZuulProxy). The
just extracts an access token from the currently authenticated user,
and puts it in a request header for the downstream requests.
+
+
+
+You can control the authorization behaviour downstream of an
@EnableZuulProxy through the proxy.auth.* settings. Example: