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

Generating Authbearer token #396

Open
vb-git14 opened this issue Sep 16, 2022 · 0 comments
Open

Generating Authbearer token #396

vb-git14 opened this issue Sep 16, 2022 · 0 comments

Comments

@vb-git14
Copy link

Hi,

I want to generate a authbearer token using a service account ruby library just like we do it using the below code:

gcloud auth application-default print-access-token

I have written a simple piece of code:

require 'googleauth'
authorizer = Google::Auth::ServiceAccountCredentials.make_creds(json_key_io: File.open('sa.json'))
token=authorizer.fetch_access_token!

I can get a token, but this needs scope. I wanted to check if it is possible to generate a token without the scope as well like we do with gcloud auth command below.

Thanks.

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

No branches or pull requests

1 participant