-
Notifications
You must be signed in to change notification settings - Fork 105
Add Service Account Authentication Support #525
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
base: master
Are you sure you want to change the base?
Add Service Account Authentication Support #525
Conversation
|
@rogiervandenberg I wanted to try it and i installed it via Running Do you you know how could i properly install it as a package while it's not merged? |
|
Hello, just wanted to leave here this issue I've encountered while trying to make this PR work: grpc/grpc-node#2993 |
…brary v10 - Implement dual CommonJS/ESM build system - Fix gRPC credentials creation for compatibility with google-auth-library v10 - Resolve ESM import issues for stream-chain and stream-json - Replace dynamic require with top-level import in service.ts
TypeScript still emits extensionless relative imports in the ESM build, so Node’s loader can’t resolve files when the package is installed from npm. The new fix-esm script runs after tsc, walks build/esm, and appends the correct .js (or index.js) suffix based on the filesystem. Wiring it into `npm run build` ensures the published artifacts always have Node-compliant specifiers without touching the TypeScript sources.
|
I've updated the PR to update to Fixed |
This PR adds support for Google Service Account authentication to the Google Ads API library, enabling server-to-server authentication without requiring OAuth2 refresh tokens.
🎯 Problem Solved
Closes #493, #83
The library previously only supported OAuth2 authentication which requires:
This approach is problematic for server-to-server applications where:
✨ Features Added
Service Account Authentication
Clean API Design
💻 Usage
Before (OAuth2 only)
After (With Service Account Support)
🔧 Implementation Details
Core Changes
ClientOptions: AddedServiceAccountClientOptionstype alongside existingOAuth2ClientOptionsServiceclass: Modified authentication logic to handle both OAuth2 and service account flowsAuthentication Flow
grpc.credentials.createFromGoogleCredential()📚 Documentation
SERVICE_ACCOUNT_AUTH.md🧪 Testing
Breaking Changes: None - this is fully backward compatible, new service account authentication is opt-in and both methods can coexist.
Dependencies: Uses existing
google-auth-librarydependency (updated to compatible version)