Overview
Learn how to implement OAuth 2.0 authentication flow in a Java command-line application using Micronaut, Picocli, and GraalVM. Follow a step-by-step guide to integrate Stack Overflow REST API authentication and authorize outgoing HTTP requests. Discover the challenges of building OAuth 2.0 flow for CLI applications and how to overcome them. Explore topics such as registering a client app, handling redirect URIs, retrieving and storing access tokens, and compiling an executable binary with GraalVM native-image. Gain practical insights to add OAuth 2.0 authentication to any CLI tool or application you develop.
Syllabus
| Intro
| Understanding Stack Overflow OAuth 2.0 flow
| Registering client app in the StackApps.com
| Preparing the "auth" command
| Handling redirect_uri in the command-line app
| Retrieving an access_token
| Storing the access_token in a file
| Using the access_token to authorize HTTP requests
| Compiling executable binary with GraalVM native-image
| Conclusion
Taught by
Szymon Stepniak