Created
November 18, 2020 21:33
-
-
Save bdemers/b02a25d46ed44af11fb413bf09f3eb77 to your computer and use it in GitHub Desktop.
Simple Spring Access Token Tool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpringBootApplication | |
public class TokenViewerApplication { | |
public static void main(String[] args) { | |
SpringApplication.run(TokenViewerApplication.class, args); | |
} | |
@RestController | |
static class TokenController { | |
@GetMapping("/token") | |
String showToken(@RegisteredOAuth2AuthorizedClient("okta") OAuth2AuthorizedClient client) { | |
return "export TOKEN='" + client.getAccessToken().getTokenValue() + "'"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment