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