Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
CFID-288: change **/password to **/secret for client admin
Browse files Browse the repository at this point in the history
Change-Id: I020c3fd0c91adb80e7997e0b28c9610c5fbf2682
  • Loading branch information
dsyer committed May 15, 2012
1 parent b6812ca commit 58f4a2e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
target/
*~
#*
.#*
*#
*/src/main/java/META-INF/
*/src/main/webapp/META-INF/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public ResponseEntity<Map<String, ClientDetails>> listClientDetails() throws Exc
return new ResponseEntity<Map<String, ClientDetails>>(map, HttpStatus.OK);
}

@RequestMapping(value = "/oauth/clients/{client}/password", method = RequestMethod.PUT)
@RequestMapping(value = "/oauth/clients/{client}/secret", method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void changeSecret(@PathVariable String client, @RequestBody SecretChangeRequest change) {

Expand Down
4 changes: 2 additions & 2 deletions uaa/src/main/webapp/WEB-INF/oauth-clients.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
<expression-handler ref="oauthWebExpressionHandler" />
</http>

<http pattern="/oauth/clients/*/password" create-session="stateless" authentication-manager-ref="emptyAuthenticationManager"
<http pattern="/oauth/clients/*/secret" create-session="stateless" authentication-manager-ref="emptyAuthenticationManager"
entry-point-ref="oauthAuthenticationEntryPoint" access-decision-manager-ref="accessDecisionManager"
xmlns="http://www.springframework.org/schema/security">
<intercept-url pattern="/oauth/clients/*/password" access="IS_AUTHENTICATED_FULLY,SCOPE_PASSWORD" />
<intercept-url pattern="/oauth/clients/*/secret" access="IS_AUTHENTICATED_FULLY,SCOPE_PASSWORD" />
<custom-filter ref="clientSecretResourceAuthenticationFilter" position="PRE_AUTH_FILTER" />
<access-denied-handler ref="oauthAccessDeniedHandler" />
</http>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public void testChangeSecret() throws Exception {
SecretChangeRequest change = new SecretChangeRequest();
change.setOldSecret(client.getClientSecret());
change.setSecret("newsecret");
result = serverRunning.getRestTemplate().exchange(serverRunning.getUrl("/oauth/clients/{client}/password"),
result = serverRunning.getRestTemplate().exchange(serverRunning.getUrl("/oauth/clients/{client}/secret"),
HttpMethod.PUT, new HttpEntity<SecretChangeRequest>(change , headers), Void.class, client.getClientId());
assertEquals(HttpStatus.NO_CONTENT, result.getStatusCode());

Expand Down

0 comments on commit 58f4a2e

Please sign in to comment.