Livepush Developers

Authentication

Get the consent screen

GET https://tokens.livepush.io/oauth2/authorize

Base URL https://tokens.livepush.io — Authentication & OAuth 2.0

Starts the authorization-code flow and returns the data needed to render a consent screen. Unlike most OAuth servers this returns JSON rather than an HTML page — you build the consent UI and post the user's decision back.

The user must already have a Livepush session; the request is authenticated by the srid cookie, not by a bearer token. The sessionID in the response is valid for 5 minutes.

Authorization

Send a valid access token in the Authorization header.

  • sessionCookie — apiKey — srid Browser session cookie set by POST /auth/signin. HttpOnly, 48-hour lifetime, scoped to the Livepush cookie domain. Used only by the auth service — the resource APIs accept bearer tokens and nothing else.
headers.txt
Authorization: Bearer YOUR_API_TOKEN

Try it

GET https://tokens.livepush.io/oauth2/authorize — This call only reads data.

Parameters

Query parameters

  • client_id string required
    Client ID issued by the developer console.
  • redirect_uri string required
    Must exactly match a redirect URI registered for the app.
    example: https://yourapp.example.com/callback
  • response_type string required
    Must be code.
    code
    example: code
  • scope string required
    Requested scopes, comma- or space-separated.
    example: streams.read,streams.videos.read
  • state string
    Opaque value echoed back on the redirect. Generate it randomly per attempt and verify it on return.

Code samples

request.sh
curl -X GET 'https://tokens.livepush.io/oauth2/authorize?client_id=%3Cclient_id%3E&redirect_uri=https%3A%2F%2Fyourapp.example.com%2Fcallback&response_type=code&scope=streams.read%2Cstreams.videos.read' \
  -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://tokens.livepush.io/oauth2/authorize?client_id=%3Cclient_id%3E&redirect_uri=https%3A%2F%2Fyourapp.example.com%2Fcallback&response_type=code&scope=streams.read%2Cstreams.videos.read', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
  },
});

if (!response.ok) {
  throw new Error(`Livepush API error ${response.status}`);
}

const data = await response.json();
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN',
}

response = requests.get('https://tokens.livepush.io/oauth2/authorize?client_id=%3Cclient_id%3E&redirect_uri=https%3A%2F%2Fyourapp.example.com%2Fcallback&response_type=code&scope=streams.read%2Cstreams.videos.read', headers=headers, timeout=30)
response.raise_for_status()
data = response.json()

Responses

Consent screen data.

application/json

  • sessionID string
    Consent session handle. Post it back with the user's decision. Valid for 5 minutes.
  • app object
    The requesting application, as registered in the developer console.
    • name string
    • avatar string
  • scope OAuth2ScopeDef[]
    The scopes being requested, one entry per scope.
    • title string
    • description string
      Currently mirrors title.
    • crucial boolean
      Marks a scope the app cannot function without.
Example 200 response response.json
{
  "sessionID": "Bk93jd0Ba",
  "app": {
    "name": "Your App",
    "avatar": "string"
  },
  "scope": [
    {
      "title": "streams.read",
      "description": "streams.read",
      "crucial": false
    }
  ]
}

No response body.