Skip to content

tomggill/axum-google-oauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Axum Google OAuth Example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages