Iblai Api Studio Auth logo

Iblai Api Studio Auth

Organization
iblai
iblai-api-studio-auth

Sign in to Open edX Studio (studio.learn.iblai.app) and the LMS from a browser window the user controls, capture the session cookies (studio_session_id, sessionid, csrftoken) with the bundled Playwright script, verify them, and write the gitignored studio.env that every /iblai-api-studio-* skill reads; --check validates an existing session in one command. Use first whenever the user wants to author or configure an Open edX course from the terminal, and again when a Studio call answers 302 to /login, 403 CSRF, or an HTML "Studio Server Error" page. Session auth only — no Api-Token, no password handling. For the build order and the other Studio skills, see /iblai-api-studio.

Overview

Publisheriblai
Repositoryvibe
Skill nameiblai-api-studio-auth
Stars
229
Forks
8
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by iblai on GitHub. Read the source before you install it.

Installation

Install the Iblai Api Studio Auth AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/iblai/vibe/tree/main/skills/content/iblai-api-studio-auth
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/iblai/vibe.git /tmp/vibe
mkdir -p .claude/skills
cp -r /tmp/vibe/skills/content/iblai-api-studio-auth .claude/skills/iblai-api-studio-auth
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Iblai Api Studio Auth in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Iblai Api Studio Auth on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Iblai Api Studio Auth is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

iblai-api-studio-auth

Studio (the Open edX CMS) has no token API for authoring: every authoring endpoint is guarded by a Django session cookie + CSRF token. This skill captures that session from a browser the user signs into, verifies it against Studio and the LMS (the LMS side shares the same login), and stores it in studio.env. Run it once per host; sessions last about two weeks.

Preflight — run this before any other Studio skill

bash
node .claude/skills/iblai-api-studio-auth/scripts/studio-login.mjs --check && grep -q '^STUDIO_ORG=.\+' studio.env && echo "STUDIO_ORG set" || echo "MISSING: run /iblai-api-studio-auth and set STUDIO_ORG in studio.env"

--check prints studio: ok · lms: ok and exits 0 when both sessions work, exits 2 when the file is missing or a session expired. Every other /iblai-api-studio-* skill starts with this line; when it fails, come back here instead of retrying calls.

What gets written

KeyValueUsed by
STUDIO_URLhttps://studio.learn.iblai.app (default) — test server https://studio.learn.iblai.orgevery /iblai-api-studio-* skill
LMS_URLhttps://learn.iblai.app (derived: strip studio.)/iblai-api-studio-lms, verification links
LMS_APP_URLhttps://lms.ibl.ai (test: https://lms.iblai.org) — the app users opencourse URLs in reports
STUDIO_ORGorg key used as the org when creating courses (set by hand once; the script preserves it)/iblai-api-studio-course-create
STUDIO_USERNAMEthe signed-in username (read from GET $LMS_URL/api/user/v1/me)LMS calls that need username
STUDIO_SESSION / STUDIO_CSRFStudio cookies studio_session_id / csrftokenStudio -b cookie + X-CSRFToken
LMS_SESSION / LMS_CSRFLMS cookies sessionid / csrftokenLMS -b cookie + X-CSRFToken
STUDIO_SESSION_EXPIREScookie expiry (ISO)"is it still valid?" without a request

The file is chmod 600 and the script adds it to .gitignore. Never print a session value — the script prints **** + last four only.

Reading the file from a script (not just the shell)

Session values are single-quoted because Django session ids contain | and :. set -a; . ./studio.env; set +a strips the quotes; a naive parser does not, and Studio answers a malformed cookie with HTTP 500 and an HTML "Studio Server Error" page, not 401/403. Strip them:

python
import re
env = {m[1]: m[2].strip().strip("'") for m in (re.match(r"^([A-Z_]+)=(.*)$", l) for l in open("studio.env")) if m}
js
const env = Object.fromEntries([...fs.readFileSync("studio.env","utf8").matchAll(/^([A-Z_]+)=(.*)$/gm)].map(([,k,v]) => [k, v.trim().replace(/^'(.*)'$/, "$1")]));

Sanity check: len(env["STUDIO_SESSION"]) is the cookie length (typically 187), with no quote characters.

Steps

  1. Run the capture script from the project directory (needs Node 18+; uses Google Chrome / Edge if installed, else Playwright's Chromium; installs playwright-core into ~/.cache/iblai-studio/ once if no Playwright is resolvable — no browser download):

    bash
    node .claude/skills/iblai-api-studio-auth/scripts/studio-login.mjs                       # production
    node .claude/skills/iblai-api-studio-auth/scripts/studio-login.mjs --studio https://studio.learn.iblai.org   # test server

    A browser window opens on $STUDIO_URL/home. Tell the user to sign in there themselves (Studio redirects to the LMS login, then back). Never type credentials for them. The script polls once a second for the studio_session_id + sessionid cookies, verifies both, writes the file, closes the browser, and prints one line:

    connected: studio.learn.iblai.app as <username> · session ****ab12 · expires 2026-09-28 → /path/studio.env

    Flags: --out <file> (default ./studio.env), --lms <url>, --lms-app <url>, --profile <dir> (browser profile, default ~/.cache/iblai-studio/profile-<host> — re-runs skip the login while the browser session lasts), --timeout <s> (default 300). Exit 1 = timed out waiting for a sign-in.

  2. Set the org key (once): STUDIO_ORG=<org key> in studio.env. Course creation needs the key of the organization the user authors in (the path segment after /platform/ on os.ibl.ai, or PLATFORM in iblai.env). If you do not know it, list the user's roles — org-instructor rows carry it:

    bash
    set -a; . ./studio.env; set +a
    curl -s -b "studio_session_id=$STUDIO_SESSION; csrftoken=$STUDIO_CSRF" -H "Accept: application/json" \
      "$STUDIO_URL/api/ibl/users/manage/roles/?username=$STUDIO_USERNAME"     # [{"role":"org-instructor","org":"acme","course":""}, …]
  3. Verify with the preflight line above.

No browser available?

Have the user copy the cookies from DevTools (Application → Cookies) on a signed-in Studio tab: studio_session_id, csrftoken; and on a signed-in LMS tab: sessionid. Write studio.env yourself with the keys above (single-quote the values), chmod 600, add it to .gitignore, then run --check. Ask for cookies in a file or env var, never pasted into the chat when avoidable.

How every Studio call is made (the snippet other skills reuse)

bash
set -a; . ./studio.env; set +a
S=(-s -b "studio_session_id=$STUDIO_SESSION; csrftoken=$STUDIO_CSRF" -H "X-CSRFToken: $STUDIO_CSRF" \
   -H "Origin: $STUDIO_URL" -H "Referer: $STUDIO_URL/" -H "Accept: application/json" -H "Content-Type: application/json")
curl "${S[@]}" "$STUDIO_URL/api/contentstore/v2/home/courses"
  • Accept: application/json is mandatory — the same URLs return HTML pages without it.
  • X-CSRFToken + Origin/Referer on the Studio origin are required on every POST/PUT/PATCH/DELETE (Django CSRF checks Origin on HTTPS).
  • LMS calls use -b "sessionid=$LMS_SESSION; csrftoken=$LMS_CSRF" -H "X-CSRFToken: $LMS_CSRF" -H "Origin: $LMS_URL" -H "Referer: $LMS_URL/".

Reading failures

You seeIt meansDo
302 → /login/… (Studio), 401 (LMS API)session expired or missingre-run step 1
403 mentioning CSRFX-CSRFToken/Origin missing or stale csrftokenresend with the snippet; re-run step 1 if it persists
403 {"error":"Permission denied"} / "You do not have permission…"signed in, but not staff/instructor on that org or course/iblai-api-studio-team, /iblai-api-management
500 + HTML "Studio Server Error" on a documented callalmost always a malformed cookie (quotes, truncation, wrong file) — or a parameter the skill flags as brokenrun --check; compare cookie length; re-read the skill's notes
HTML page instead of JSON with 200missing Accept: application/jsonadd the header

Notes

  • One studio.env = one host. Switching between production and the test server means re-running with --studio (or keeping two files and --out).
  • The script never sees or stores a password; the browser profile directory under ~/.cache/iblai-studio/ holds the browser's own cookies — delete it to force a fresh login.
  • Studio's session is created by an OAuth round trip through the LMS (/login/edx-oauth2/ → LMS login → /complete/edx-oauth2/), which is why the LMS sessionid is always available too and why both are captured.
  • Headless/CI: there is no service-account path for Studio authoring. For org-level user and role administration use /iblai-api-management (Api-Token); for catalog and enrollment data use /iblai-api-catalog.
  • Family index and build order: /iblai-api-studio.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Iblai Api Studio Auth AI skill do?

Sign in to Open edX Studio (studio.learn.iblai.app) and the LMS from a browser window the user controls, capture the session cookies (studio_session_id, sessionid, csrftoken) with the bundled Playwright script, verify them, and write the gitignored studio.env that every /iblai-api-studio-* skill reads; --check validates an existing session in one command. Use first whenever the user wants to author or configure an Open edX course from the terminal, and again when a Studio call answers 302 to /login, 403 CSRF, or an HTML "Studio Server Error" page. Session auth only — no Api-Token, no passwo...

Why use Iblai Api Studio Auth on TypingMind?

Because you install it once and use it with any model. Iblai Api Studio Auth is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Iblai Api Studio Auth in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/iblai/vibe/tree/main/skills/content/iblai-api-studio-auth. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Iblai Api Studio Auth?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Iblai Api Studio Auth?

As many as you like. As long as a model supports skills, you can use Iblai Api Studio Auth with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Iblai Api Studio Auth AI skill free?

Yes. It is published on GitHub by iblai under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇