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

Add an endpoint to return TSD Token #55

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,16 @@ protected String getElixirAAIToken(String bearerAuthorization) {
return bearerAuthorization.replace("Bearer ", "");
}

/**
* Gets TSD token.
*
* @param bearerAuthorization Elixir AAI token.
* @return TSD token.
*/
@GetMapping("/gettoken")
public ResponseEntity<?> getToken(@RequestHeader(HttpHeaders.PROXY_AUTHORIZATION) String bearerAuthorization) {
Token token = tsdFileAPIClient.getToken(TOKEN_TYPE, TOKEN_TYPE, getElixirAAIToken(bearerAuthorization));
return ResponseEntity.ok(token);
}

}
Loading