Skip to main content
The authentication flow differs based on whether you’re using a private or public application.

Private Application Flow (Authorization Code)

  1. Redirect Users to Authorization URL Construct the authorization URL with your client_id and callback_url:
  2. Handle the Callback After authorization, CoLoop redirects to your callback URL with an authorization code:
  3. Exchange Code for Tokens Make a POST request to the token endpoint:

Public Application Flow (PKCE)

  1. Generate PKCE Challenge
  2. Redirect to Authorization URL with PKCE
  3. Exchange Code for Tokens

Using the Access Token

For both flows, use the access token to make authenticated requests:

Token Refresh

When the access token expires (after 2 hours), use the refresh token to get a new one:

Security Considerations

  1. Token Storage
    • Store access tokens and refresh tokens securely
    • For public applications, use secure browser storage mechanisms
    • For private applications, use server-side secure storage
  2. PKCE Verifier
    • Generate a new code verifier for each authorization request
    • Store the verifier securely until the token exchange
  3. Error Handling
    • Handle token expiration and refresh scenarios gracefully
    • Implement retry logic with exponential backoff for failed requests