Sloxly Docs
OAuth Captcha Console

OAuth 2.0 Integration

Sloxly OAuth 2.0 lets users sign in to your application with their Sloxly account. This guide covers the complete integration flow.

Before starting, create OAuth credentials in the Developer Console.

How It Works

The OAuth 2.0 flow uses the Authorization Code grant type:

  1. Redirect — Your app redirects the user to Sloxly's authorization endpoint
  2. Login — The user signs in and approves your app
  3. Callback — Sloxly redirects back to your app with an authorization code
  4. Exchange — Your server exchanges the code for an access token
  5. API Call — Use the token to fetch user information

Endpoints

EndpointURLMethod
Authorizationhttps://api.sloxly.com/v1/Oauth/authorizationGET
Tokenhttps://api.sloxly.com/v1/Oauth/tokenPOST
User Infohttps://api.sloxly.com/v1/Oauth/userinfoGET

Quick Start

Here's a minimal implementation in PHP:

PHP
// Step 1: Redirect to Sloxly
$params = http_build_query([
    'client_id'    => $your_client_id,
    'redirect_uri' => 'https://yoursite.com/callback',
]);
header("Location: https://api.sloxly.com/v1/Oauth/authorization?$params");

// Step 2: Exchange code for token (in callback.php)
$response = curl_post("https://api.sloxly.com/v1/Oauth/token", [
    'client_id'     => $client_id,
    'client_secret' => $client_secret,
    'code'          => $_GET['code'],
]);