Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new auth architecture #924

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Ubisoft-potato
Copy link
Collaborator

@Ubisoft-potato Ubisoft-potato commented Apr 22, 2024

Fixes #919

This PR implements a new authentication architecture in the auth module. This architecture will support the addition of new authentication methods, such as Github, SSO, etc.

Key changes

  • add new oauth configuration to support multi authentication method:
    oauth:
      key:
        secret: 
        public:
      google: 
        issuer: https://accounts.google.com
        clientId: bucketeer
        clientSecret:
        redirectUrl:
    google is used to configure for Google Authentication.
  • remove issuer cert secret, because we don't need dex anymore.
  • parse oauth configuration file, then use the configuration file to create auth service and token verifier
  • unify interface for authentication
  • add auth_type field in auth proto file to support multi authentication method
  • implement Google Authentication in auth service

Minor changes


New authentication workflow

  1. Call GetAuthCodeURL to get the Login URL
  2. User confirm login then user will be redirected to our redirect_url with code
  3. Call ExchangeToken with code to get Bucketeer Token
  4. When Bucketeer Token expired, call RefreshTokenRequest with refresh_token to refresh Bucketeer Token

Check the illustration.


This pull request primarily introduces changes to improve the OAuth configuration in the Bucketeer backend and batch services. The key changes involve the addition of a new 'provider' field in the service token generation command, removal of the issuer-cert-secret, and restructuring of the OAuth configuration.

Here's a breakdown of the most important changes:

Service Token Generation:

  • Makefile: Added a new 'provider' option in the generate-service-token command.
  • hack/generate-service-token/command.go: Introduced a new 'provider' field in the command structure and updated the command registration and execution functions to include this new field. [1] [2] [3]

OAuth Configuration:

Batch Service OAuth Configuration:

@Ubisoft-potato Ubisoft-potato force-pushed the feature-google-authentication branch 2 times, most recently from 27f4cb7 to c976cfa Compare April 23, 2024 07:21
@Ubisoft-potato Ubisoft-potato marked this pull request as ready for review April 24, 2024 04:18
@Ubisoft-potato
Copy link
Collaborator Author

Ubisoft-potato commented Apr 26, 2024

Here is a auth archtechture change illustration:

image

The Admin Console need to make some changes to support the new auth archtechture:

  • We still need to develop a new login page in Admin Console, currently the login page is in dex service.
  • The Admin Console redirect url if user not login should change to the new login page.
  • The new login page will request to the new Auth API with auth_type parameter
    • GetAuthCodeURL
    • ExchangeToken
    • RefreshToken

@Ubisoft-potato Ubisoft-potato force-pushed the feature-google-authentication branch from 8c9c09a to a789e4c Compare May 2, 2024 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore: remove dex dependency
1 participant