Skip to content

Commit

Permalink
Merge 1581074 into 118e38e
Browse files Browse the repository at this point in the history
  • Loading branch information
wwelling committed Apr 1, 2020
2 parents 118e38e + 1581074 commit c04a77d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Expand Up @@ -52,11 +52,9 @@ public RedirectView token(@RequestParam Map<String, String> params, @RequestHead
}

@RequestMapping("/refresh")
public ApiResponse refresh(@RequestParam Map<String, String> params, @RequestHeader Map<String, String> headers) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException {
public ApiResponse refresh(@RequestParam(required = true) String token) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException {
LOG.debug("Refresh token requested.");
// NOTE: this only works with shibboleth payload in the headers
// if not behind service provider a token can be crafted without authentication!!!!!
return new ApiResponse(SUCCESS, "Token refresh successful.", tokenService.craftToken(headers));
return new ApiResponse(SUCCESS, "Token refresh successful.", tokenService.refreshToken(token));
}

}
Expand Up @@ -74,12 +74,8 @@ public RedirectView token(@RequestParam Map<String, String> params, @RequestHead

@Override
@RequestMapping("/refresh")
public ApiResponse refresh(@RequestParam Map<String, String> params, @RequestHeader Map<String, String> headers) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException {
public ApiResponse refresh(@RequestParam(required = true) String token) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException {
LOG.debug("Refresh token requested.");
String token = params.get("token");
if (token == null) {
throw new RuntimeException("Cannot refresh without token!");
}
return new ApiResponse(SUCCESS, "Token refresh successful.", tokenService.refreshToken(token));
}

Expand Down

0 comments on commit c04a77d

Please sign in to comment.