Package Information
Released: 7/2/2025
Downloads: 16 weekly / 39 monthly
Latest Version: 0.5.15
Author: Mrowr Purr
Available Nodes
Documentation
n8n-nodes-withings-oauth2-credential
A community node package for n8n that provides OAuth2 authentication for the Withings API.
Features
- Custom OAuth2 Credential: Handles Withings' non-standard OAuth2 implementation that requires
action=requesttokenduring token exchange - Automatic Token Management: n8n handles authorization, token exchange, storage, and refresh automatically
- Clean Integration: Use with HTTP Request nodes or any custom Withings nodes
- Dummy Node Included: Contains a minimal dummy node to satisfy n8n package requirements (use HTTP Request nodes instead)
Installation
Community Nodes (Recommended)
- Go to Settings → Community Nodes in your n8n instance
- Click Install a community node
- Enter:
n8n-nodes-withings-oauth2-credential - Click Install
Manual Installation
npm install n8n-nodes-withings-oauth2-credential
Setup
1. Create Withings Developer App
- Go to Withings Developer Portal
- Create a new application
- Set the Callback URL to:
https://your-n8n-instance.com/rest/oauth2-credential/callback - Note your Client ID and Client Secret
2. Configure Credential in n8n
- In n8n, go to Credentials → Add Credential
- Search for "Withings OAuth2 API"
- Fill in:
- Client ID: From your Withings app
- Client Secret: From your Withings app
- Scope:
user.info,user.metrics,user.activity(or customize as needed)
- Click Connect my account
- Complete the OAuth2 authorization flow
Usage
With HTTP Request Node (Recommended)
- Add an HTTP Request node to your workflow
- Set Authentication to "Predefined Credential Type"
- Select Credential Type: "Withings OAuth2 API"
- Choose your configured credential
- Configure your request:
- Method: POST
- URL:
https://wbsapi.withings.net/v2/user - Body:
action=getbyuserid(or other Withings API actions)
Dummy Node
This package includes a "Withings Dummy" node to satisfy n8n's package requirements, but it's recommended to use HTTP Request nodes instead for actual API calls.
Example API Calls
Get User Info:
POST https://wbsapi.withings.net/v2/user
Body: action=getbyuserid
Get Measurements:
POST https://wbsapi.withings.net/v2/measure
Body: action=getmeas&startdate=1609459200&enddate=1640995200
How It Works
Withings uses a non-standard OAuth2 implementation that requires an additional action=requesttoken parameter during token exchange. This credential:
- Extends n8n's genericAuth: Provides full control over the token exchange process
- Injects Required Parameter: Automatically adds
action=requesttokento token requests - Handles Standard Flow: Authorization URL, redirect, and token storage work normally
Technical Details
- Credential Type:
genericAuthwith customauthenticate()method - Authorization URL:
https://account.withings.com/oauth2_user/authorize2 - Token URL:
https://wbsapi.withings.net/v2/oauth2 - Required Parameter:
action=requesttoken(automatically injected)
Troubleshooting
"Invalid Grant" Error
- Ensure your redirect URI in Withings matches exactly:
https://your-n8n-instance.com/rest/oauth2-credential/callback - Check that your Client ID and Client Secret are correct
"Scope Error"
- Verify the scopes in your credential match what's configured in your Withings app
- Common scopes:
user.info,user.metrics,user.activity,user.sleepevents
Token Refresh Issues
- n8n handles token refresh automatically
- If issues persist, re-authorize the credential
Development
# Clone the repository
git clone https://github.com/mrowrpurr/n8n-nodes-withings-oauth2-credential.git
cd n8n-nodes-withings-oauth2-credential
# Install dependencies
npm install
# Build
npm run build
# Lint
npm run lint
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.