Communication
- Gmail (Google Workspace)
- Outlook (Microsoft 365)
- Slack
- Microsoft Teams
- Discord
Learn about Agent Auth, Scalekit's authentication solution for securely connecting to third-party applications through OAuth 2.0
Agent Auth is Scalekit’s authentication solution that enables your applications to securely connect to third-party services on behalf of your users. It handles the complexity of OAuth flows, token management, and multi-provider authentication for popular business applications like Gmail, Slack, Jira, and more.
Agent Auth simplifies third-party authentication by providing:
Providers are third-party applications that your users can authenticate with. Agent Auth supports OAuth 2.0 flows for popular platforms including Gmail, Slack, GitHub, Jira, and many more.
Connections define the authentication configuration for a specific provider. Each connection contains:
Connected accounts represent the authenticated link between a user in your application and their account on a third-party provider. Each connected account maintains:
Set up OAuth credentials for each provider you want to support:
// Create a connection for Gmail with OAuth 2.0const gmailConnection = await agentConnect.connections.create({ provider: 'gmail', auth_type: 'oauth2', credentials: { client_id: 'your-gmail-client-id', client_secret: 'your-gmail-client-secret' }, scopes: ['https://www.googleapis.com/auth/gmail.send']});When users want to connect their accounts, create a connected account and redirect them to complete OAuth:
// Create a connected account for a userconst connectedAccount = await agentConnect.accounts.create({ connection_id: gmailConnection.id, identifier: 'user_123', identifier_type: 'user_id'});
// Generate OAuth authorization URLconst authUrl = await agentConnect.accounts.getAuthUrl(connectedAccount.id);// Redirect user to authUrl to authenticate with the providerAfter the user authorizes your application, the provider redirects back with an authorization code. Agent Auth automatically exchanges this code for access and refresh tokens:
// Agent Auth handles the OAuth callback and token exchange// Tokens are securely stored and automatically refreshed when neededconst account = await agentConnect.accounts.get(connectedAccount.id);// account.status will be 'active' once authentication is completeAgent Auth supports OAuth authentication for a wide range of popular business applications:
Communication
Productivity
Project Management
Development
Enable users to connect multiple third-party accounts in your application:
// Allow users to authenticate with both Gmail and Slackconst gmailAccount = await agentConnect.accounts.create({ connection_id: gmailConnection.id, identifier: 'user_123', identifier_type: 'user_id'});
const slackAccount = await agentConnect.accounts.create({ connection_id: slackConnection.id, identifier: 'user_123', identifier_type: 'user_id'});
// Generate OAuth URLs for each providerconst gmailAuthUrl = await agentConnect.accounts.getAuthUrl(gmailAccount.id);const slackAuthUrl = await agentConnect.accounts.getAuthUrl(slackAccount.id);Authenticate once for an entire organization:
// Create organization-level connection for shared accessconst orgConnection = await agentConnect.accounts.create({ connection_id: jiraConnection.id, identifier: 'org_456', identifier_type: 'org_id'});
// All users in the organization can access this connectionconst authUrl = await agentConnect.accounts.getAuthUrl(orgConnection.id);Agent Auth automatically handles token refresh and expiration:
// Retrieve connected account - tokens are automatically refreshed if expiredconst account = await agentConnect.accounts.get(connectedAccount.id);
// Check authentication statusif (account.status === 'active') { // User is authenticated and tokens are valid} else if (account.status === 'expired') { // Re-authentication required const reAuthUrl = await agentConnect.accounts.getAuthUrl(account.id);}Agent Auth supports multiple authentication approaches:
Use Scalekit’s shared OAuth applications for quick setup:
Use your own OAuth applications for complete control:
Ready to start using Agent Auth? Here’s what you need to do:
Agent Auth simplifies third-party authentication so you can focus on building features instead of managing OAuth flows. Start building today and provide seamless authentication experiences for your users.