I'm trying to use the Google Wallet API to generate custom passes, but I'm encountering an issue with the OAuth 2.0 authorization process. When I request the https://www.googleapis.com/auth/wallet_object.issuer
scope, I get an invalid_scope
error. Here are the steps I've followed and the issue details:
Steps Followed
Enabled Google Wallet API:
- Went to Google Cloud Console.
- Navigated to APIs & Services > Library.
- Enabled the Google Wallet API for my project.
Configured OAuth Consent Screen:
- Filled in required fields in the consent screen.
- Tried to add the
https://www.googleapis.com/auth/wallet_object.issuer
scope but received an error stating it’s an invalid scope.
Created OAuth 2.0 Client Credentials:
- Selected Web application as the application type.
- Added
http://localhost:5173/oauth2callback
as the authorized redirect URI.
Generated Authorization URL:
- Used the Google OAuth2Client to generate the authorization URL with the following scopes:
https://www.googleapis.com/auth/wallet_object.issuer
- Used the Google OAuth2Client to generate the authorization URL with the following scopes:
Code Snippet (Node.js/Express)
app.get('/generate-auth-url', (req, res) => {
const authUrl = oAuth2Client.generateAuthUrl({
access_type: 'offline',
scope: ['https://www.googleapis.com/auth/wallet_object.issuer']
});
});
Issue
When accessing the generated authorization URL, I receive the following error:
Screenshot of Error
Documentation Reference
The scope https://www.googleapis.com/auth/wallet_object.issuer
is documented in the Google Wallet API documentation.
Attempted Workaround
I also tried using the OAuth 2.0 Playground to manually obtain tokens with the required scope, but encountered the same issue with the invalid_scope
error.
Any idea on how to tackle this issue? I'm starting to think this is a bug from Google's side.
Any help or guidance would be greatly appreciated!