Lark Auth icon

Lark Auth

Lark Auth Management

Overview

This node, named "Lark Auth," is designed to manage authentication tokens for the Lark platform. Specifically, it supports refreshing user access tokens under the "User ID" resource and "Refresh Accesstoken" operation. This functionality is essential when integrating with Lark APIs that require valid access tokens for authorization.

Common scenarios include:

  • Automatically refreshing expired or soon-to-expire user access tokens in workflows.
  • Managing authentication seamlessly when interacting with Lark services via OAuth2 or tenant token methods.
  • Customizing the request body for advanced use cases where default token refresh parameters need to be overridden.

Practical example:

  • A workflow that periodically refreshes a user's access token using OAuth2 credentials to maintain uninterrupted API access.
  • Using a tenant token to refresh access tokens for service accounts in an enterprise environment.

Properties

Name Meaning
Authentication Method of authentication to use: either "Tenant Token" or "OAuth2".
Use Custom Body Boolean flag indicating whether to send a custom JSON body instead of the default one.
Custom Body JSON object representing a custom request body to send when "Use Custom Body" is enabled.

Output

The node outputs JSON data containing the response from the Lark API after attempting to refresh the access token. This typically includes new access token details such as the token string, expiration time, and possibly refresh token information.

No binary data output is involved.

Dependencies

  • Requires an API key credential configured either as a Tenant Token or OAuth2 authentication within n8n.
  • The node makes HTTP requests to the Lark Suite API endpoint at https://open.larksuite.com.
  • Proper configuration of credentials in n8n is necessary for successful token refresh operations.

Troubleshooting

  • Invalid Credentials Error: Occurs if the provided authentication credentials are incorrect or expired. Verify that the API keys or OAuth2 tokens are valid and have not been revoked.
  • Network Errors: Could happen due to connectivity issues or incorrect base URL configurations. Ensure network access to https://open.larksuite.com is available.
  • Malformed Custom Body: If "Use Custom Body" is enabled but the JSON is invalid or missing required fields, the API may reject the request. Validate the JSON structure before sending.
  • Permission Denied: The authenticated user or token might lack permissions to refresh tokens. Check the scopes and roles assigned to the credentials.

Links and References

Discussion