Actions115
- Account Actions
- Announcements Actions
- Apps Actions
- Authentication Actions
- Blocks Actions
- Bookmarks Actions
- Canonical Email Blocks Actions
- Cohorts Actions
- Conversations Actions
- Custom Emojis Actions
- Directory Actions
- Domains (Allowed) Actions
- Domains (Blocked) Actions
- Domains (Email Blocked) Actions
- Emails Actions
- Endorsements Actions
- Favourites Actions
- Featured Tags Actions
- Filters Actions
- Follow Requests Actions
- Followed Tags Actions
- Instance Actions
- IPs Actions
- Lists Actions
- Markers Actions
- Measures Actions
- Media Actions
- Mutes Actions
- Notifications Actions
- oEmbed Actions
- Polls Actions
- Preferences Actions
- Profile Actions
- Proofs Actions
- Push Actions
- Reports Actions
- Retention Actions
- Scheduled Statuses Actions
- Search Actions
- Status Actions
- Streaming Actions
- Suggestions Actions
- Tags Actions
- Timeline Actions
Authentication → Obtain Token
AI-generatedOverview
This node operation handles obtaining an OAuth2 token for authenticating with a Mastodon instance. It is used when integrating Mastodon API access into workflows, allowing secure OAuth2 authentication by exchanging an authorization code for an access token. This is essential for scenarios where users need to authenticate via OAuth2 to perform actions on Mastodon on their behalf.
Use Case Examples
- A user configures the node with their Mastodon instance URL, OAuth2 client ID, client secret, authorization code, and redirect URI to obtain an access token for subsequent API calls.
- Automating Mastodon posting or data retrieval by first obtaining an OAuth2 token programmatically within an n8n workflow.
Properties
| Name | Meaning |
|---|---|
| Mastodon URL | URL of the Mastodon instance to connect to, used as the base URL for authentication requests. |
| Authentication Type | Method of authentication to use; must be OAuth2 for obtaining a token in this operation. |
| Client ID | OAuth client ID required for the OAuth2 token request. |
| Client Secret | OAuth client secret required for the OAuth2 token request. |
| Authorization Code | Code received from the OAuth authorization step, used to exchange for an access token. |
| Redirect URI | Redirect URI that matches the app registration, required for OAuth2 token exchange. |
Output
JSON
json- The JSON object containing the obtained OAuth2 token and related authentication data.
Dependencies
- Requires OAuth2 credentials including client ID, client secret, and authorization code obtained from Mastodon OAuth authorization flow.
Troubleshooting
- Error if OAuth2 credentials are missing or invalid: Ensure that the OAuth2 client ID, client secret, and authorization code are correctly provided.
- Error if Authentication Type is not OAuth2: This operation requires OAuth2 authentication type; selecting Access Token will cause an error.
- If the Mastodon URL is incorrect or unreachable, the token request will fail; verify the URL is correct and the instance is accessible.