Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 1.1 KB

README.md

File metadata and controls

22 lines (16 loc) · 1.1 KB

axum-google-oauth

axum-google-oauth is a barebones example implementation of the oauth-axum crate for authenticating with the Google OAuth 2.0 API and retrieving user information.

More information about this crate can be found in the crate documentation.

Implementation

  1. Create an OAuth 2.0 Client ID and Client Secret in the Google Cloud Platform Console by following these instructions. See here.
  2. Clone the repository.
  3. Copy the .env.example file, rename it to .env, and copy across your Client ID and Client Secret obtained in step 1.
  4. Modify the implementation to suit your requirements.

How to use

  1. Perform cargo run in the repository.
  2. Make a GET request to the create_url endpoint:
    • curl http://localhost:3000/
  3. Open the returned URL in your browser.
  4. Login to your google account.
  5. See the user information in the callback.