-
Notifications
You must be signed in to change notification settings - Fork 258
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
Getting id-token from compute engine default service account not working #299
Comments
It seems the target_audience option is not being saved. If you do As a workaround you can do |
Thanks for workaround, I also expected But it is also not yet documented: |
I had the same problem using Cloud Run. Looking at the code, the problem is at line 63 of |
I've had the same problem, using Cloud Run and Could Job. I believe I've fixed the issue in this PR: require "googleauth"
module Google::Auth
module_function
def get_application_default(scope = nil, options = {})
creds = DefaultCredentials.from_env(scope, options) ||
DefaultCredentials.from_well_known_path(scope, options) ||
DefaultCredentials.from_system_default_path(scope, options)
return creds unless creds.nil?
unless GCECredentials.on_gce? options
GCECredentials.unmemoize_all
raise NOT_FOUND_ERROR
end
# Merge option with the scope and pass this down to the Oauth2 client
GCECredentials.new(options.merge(scope: scope))
end
end This works and I now get an |
So many thanks @StupidCodeFactory, I spent an hour banging my head against this before I realized the fix was in the latest gem! |
Environment details
Description
I want to make a call to an api in a iap secured app engine from a compute engine with the proper service account.
I am trying to follow this link
which included the ruby code to do the job, but its not working
NOTE: Node code works perfectly
Steps to reproduce
Code example
Thanks!
The text was updated successfully, but these errors were encountered: