HelpCore Docs
Sign In

Configuring Authentication Flow

Sarah Jenkins

Lead Developer Advocate

calendar_today Last updated Oct 14, 2024
timer 8 min read

Authentication is the cornerstone of any secure application. HelpCore provides a robust, multi-layered authentication framework that supports OAuth2, OpenID Connect, and traditional API key mechanisms. This guide will walk you through the primary flow configuration.

Core Mechanics

The HelpCore identity provider operates on a stateless JWT-based system. When a client initiates a handshake, the system validates the request through several security checkpoints including IP allowlisting and rate-limiting.

  • Token Issuance: Standard expiration is 3600 seconds.
  • Refresh Strategy: Rotational tokens are enabled by default for mobile clients.
  • Scoped Access: Granular permissions defined in the dashboard UI.
info Note

Always use HTTPS for all authentication endpoints. HelpCore rejects any plaintext requests at the gateway level to ensure data integrity.

Implementation

To begin the integration, you must first register your application in the Developer Console to receive your CLIENT_ID and CLIENT_SECRET.

// Initialize the HelpCore SDK
import { HelpCoreAuth } from '@helpcore/sdk-auth';

const auth = new HelpCoreAuth({
  clientId: process.env.HC_CLIENT_ID,
  redirectUri: 'https://app.example.com/callback',
  scopes: ['read:profile', 'write:settings']
});

// Trigger login flow
await auth.loginWithRedirect();

Error Handling

The SDK will throw specific exceptions for common failures. Handling these gracefully ensures a better user experience for your customers.

Was this article helpful?

Help us improve by providing quick feedback.

Related Articles