Integrating Google FIT API: Handling Multiple Scopes in Initial Authorization Request

47 Views Asked by At

I'm currently working on integrating the Google FIT API into my JavaScript application, and I'm encountering an issue when trying to include multiple scopes in the initial authorization request.

The following request works perfectly with a single scope:

https://accounts.google.com/o/oauth2/auth?[clientID]&redirect_uri=https://health.silkland.com&scope=https://www.googleapis.com/auth/fitness.activity.read&response_type=code&access_type=offline

However, when attempting to include more than one scope with a space between them, as shown below, it doesn't seem to work as expected:

https://accounts.google.com/o/oauth2/auth?[clientID]&redirect_uri=https://health.silkland.com&scope=https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.heart_rate.read&response_type=code&access_type=offline

Is there a specific syntax or method I should follow to include multiple scopes in the authorization call? I appreciate any guidance or examples demonstrating the correct way to structure the request for multiple scopes. Thank you!

0

There are 0 best solutions below