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

Adding support for google oauth2 authentication in the omni-executor #3244

Merged
merged 17 commits into from
Jan 29, 2025

Conversation

silva-fj
Copy link
Contributor

This PR introduces support for google oauth2 authentication for native calls as well as some refactoring: Renamed the primitives crate to executor-primitives and updated all relevant references in the codebase.

Implements Display trait for AuthenticationError to provide better error
messages for logging and user feedback. This also fixes the dead code
warning for AuthTokenError variant.
Adds implementation of Google OAuth2 token verification for
authentication. This includes:
- State verifier validation
- Token exchange using authorization code
- ID token decoding and validation
- Identity verification against sender's identity
Changes auth token claims to use sender identity hash instead of omni
account. This simplifies the auth token verification process by removing
the dependency on omni account storage and making the verification more
direct.
@silva-fj silva-fj requested review from kziemianek, Kailai-Wang and a team January 29, 2025 11:11
Copy link

linear bot commented Jan 29, 2025

@@ -0,0 +1,102 @@
mod oauth2_client;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be moved out of identity-verificaiton / heima context ? To me it looks like just general oauth

Copy link
Contributor Author

@silva-fj silva-fj Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, in the identity worker we have this in litentry/core/data-providers but since we are not sure if we are going to support the identity/vc related stuff in the omni-executor I didn't create that structure. I'll create an oauth-providers crate as we might add support for others

Implements a new RPC endpoint `omni_getOAuth2GoogleAuthorizationUrl` that
generates and returns an authorization URL for Google OAuth2 authentication
flow. The endpoint:

- Takes Google account and redirect URI as parameters
- Stores state verifier in database for security
- Returns hex-encoded authorization URL
- Integrates with existing identity verification system
Moves Google OAuth2 client implementation from identity-verification crate
to the new oauth-providers crate for better code organization.
@silva-fj silva-fj enabled auto-merge (squash) January 29, 2025 16:04
@silva-fj silva-fj merged commit a414093 into dev Jan 29, 2025
20 checks passed
@silva-fj silva-fj deleted the p-1284-add-support-for-google-oauth2-authentication branch January 29, 2025 16:07
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.

2 participants