Cristian Avalos
Cristian Avalos

Reputation: 333

generate an access token for a external API to use firebase functions

I am having trouble understanding how to accomplish this. I have Firebase functions running on my application. I am using an external API in which I can configure Webhooks to hit an endpoint on my Firebase functions to perform an action. To make sure that the call comes from this external API, they recommend using an oauth2 flow. Mainly they ask me for:

Provide us (the external API) with an ID and an access token; 
these are used to access a URL which provides a bearer token; 
this bearer token is then used to access the provided webhook URL until the bearer 
token expires after a pre-determined period of time.

And there are 4 input fields:

1. OAuth2 access token url
2. OAuth2 client id
3. OAuth client secret
4. OAuth2 Scope.  <---- NOT SURE WHAT THIS ONE MEANS

My question is how do I generate the access token and the client id for this external API? What value should I put for the oAuth2 scope?

Thanks!

Upvotes: 1

Views: 1098

Answers (2)

Cristian Avalos
Cristian Avalos

Reputation: 333

I was able to figure this out using auth0. In one of their documentations, they cleared explained what I was trying to accomplish. Posting here to future reference in case any one needs it.

Thanks all!

reference: https://auth0.com/docs/authorization/flows/client-credentials-flow#learn-more

Upvotes: 2

Farid Shumbar
Farid Shumbar

Reputation: 1420

You can generate the client ID and client secret in the Console > Credentials.

Cloud Functions API oAuth2 scope is https://www.googleapis.com/auth/cloud-platform.

Upvotes: 0

Related Questions