Logo: Iblai Api Studio Auth

Iblai Api Studio Auth

Organisatioun
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.

Iwwersiicht

Editeuriblai
Repositoryvibe
Skill-Nummiblai-api-studio-auth
Stären
229
Forks
8
Matgeliwwert Dateien
1
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 1 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    iblai huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Iblai Api Studio Auth an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/iblai/vibe/tree/main/skills/content/iblai-api-studio-auth
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Iblai Api Studio Auth an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Iblai Api Studio Auth automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Iblai Api Studio Auth net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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 passwo...

Firwat Iblai Api Studio Auth op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Iblai Api Studio Auth besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Iblai Api Studio Auth an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/iblai/vibe/tree/main/skills/content/iblai-api-studio-auth an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Iblai Api Studio Auth benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Iblai Api Studio Auth benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Iblai Api Studio Auth domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Iblai Api Studio Auth gratis?

Jo. iblai huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇