Hilfe

Hier findet ihr Anleitungen, Erklärungen und alles Wichtige rund um Wortfreunde. Damit ihr das Beste aus eurer Content Arbeit herausholen könnt.

Get Access Tokens

The SSO API allows external systems (e.g., SharePoint, intranet portals) to generate one-time login tokens. These tokens let users access Wortfreunde Studio directly, without entering credentials, by appending a ?sso=TOKEN parameter to any Studio URL.

Prerequisites

  • An API token with the write:sso scope (create one here)
  • The account and team IDs for your Studio instance (found on the API Tokens page under Settings → API Tokens)

Create an SSO Token

POST /sso_tokens

Request Body

{
  "email": "jane.doe@example.com",
  "first_name": "Jane",
  "last_name": "Doe"
}
FieldTypeRequiredDescription
emailstringYesEmail address of the user
first_namestringYesFirst name (only used when creating a new user)
last_namestringYesLast name (only used when creating a new user)

Example Request

curl -s -X POST "https://api.wortfreunde.ch/v1/sso_tokens" \
  -H "Authorization: Bearer $WORTFREUNDE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "jane.doe@example.com", "first_name": "Jane", "last_name": "Doe"}' \
  | python3 -m json.tool

Response

Status: 201 Created

{
  "token": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w",
  "user_created": true
}
FieldTypeDescription
tokenstringOne-time login token (URL-safe, 43 characters)
user_createdbooleantrue if a new user was created, false if an existing user was found

Error Responses

CodeError CodeDescription
401missing_tokenMissing or invalid API key
403-Token lacks write:sso scope
422parameter_missingMissing required field (email, first_name, or last_name)

SSO Login Flow

  1. Request: Your system calls POST /sso_tokens with the user's email and name
  2. Provisioning: Wortfreunde finds the user by email, or creates a new account with editor role
  3. Token: A one-time token is returned (valid for 5 minutes)
  4. Redirect: Your system redirects the user's browser to any Studio URL with the token appended:
    https://studio.wortfreunde.ch/client/123/t/42/posts?sso=TOKEN
    
  5. Login: Wortfreunde validates and consumes the token, signs the user in, and redirects to the clean URL (without ?sso=)

User Roles

ScenarioRole Assigned
New user (email not found)editor, limited access to posts and ideas
Existing user, not yet in this accounteditor, added to account with limited access
Existing user, already in accountUnchanged, keeps their current role

Example: SharePoint Integration

// SharePoint Flow: Generate SSO token and redirect user
async function openWortfreunde(userEmail, firstName, lastName, targetPath) {
  const response = await fetch('https://api.wortfreunde.ch/v1/sso_tokens', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer ' + API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      email: userEmail,
      first_name: firstName,
      last_name: lastName
    })
  });

  const { token } = await response.json();

  // Redirect the user to Wortfreunde Studio
  window.open(
    `https://studio.wortfreunde.ch${targetPath}?sso=${token}`
  );
}

Next Steps

  • Chromeless Mode: embed Studio pages without navigation, ideal for combining with SSO