-
Notifications
You must be signed in to change notification settings - Fork 23
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
Change authentication method to use OIDC identity tokens #322
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,12 +55,11 @@ def __init__( | |
self._api_client = ApiClient(config) | ||
|
||
if use_google_oauth: | ||
import google.auth | ||
from caraml_auth.id_token_credentials import get_default_id_token_credentials | ||
from google.auth.transport.requests import Request | ||
from google.auth.transport.urllib3 import urllib3, AuthorizedHttp | ||
|
||
# Load default credentials | ||
credentials, _ = google.auth.default(scopes=TuringSession.OAUTH_SCOPES) | ||
credentials = get_default_id_token_credentials(target_audience="turing-sdk.caraml") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is unused right now. But we can set up the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see.. I wonder if we should simply call it "sdk.caraml" in order to not distinguish each SDK. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine with any name to be honest 😅 |
||
# Refresh credentials, in case it's coming from Compute Engine. | ||
# See: https://github.com/googleapis/google-auth-library-python/issues/1211 | ||
credentials.refresh(Request()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated this since this version is used in
caraml-auth-google
.