Chuyển đến nội dung
Skillpedia
Bảo mật84k · #1420

omni-auth

Skill này làm gì

Skill này chỉ cách xác thực với API và bảng điều khiển OmniRoute. Skill dành cho lập trình viên và quản trị viên cần đăng nhập, lấy phiên làm việc hoặc thiết lập tùy chọn đăng nhập.

Khi nào nên dùng

  • ✓Khi người dùng cần xác thực một yêu cầu bằng bearer token.
  • ✓Khi người dùng cần đăng nhập vào bảng điều khiển OmniRoute hoặc lấy session cookie.
  • ✓Khi người dùng muốn thiết lập đăng nhập một lần (SSO) hoặc thay đổi yêu cầu đăng nhập.

Liên kết skill

https://github.com/cheaper-inference/OmniRoute/blob/release/v3.8.53/skills/omni-auth/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/cheaper-inference/OmniRoute/blob/release/v3.8.53/skills/omni-auth/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm sao để tôi đăng nhập OmniRoute từ script để lấy access token?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill liệt kê endpoint đăng nhập, nhận mật khẩu quản trị và trả về session cookie, cùng endpoint đăng xuất, cần một token bảo mật. Skill cũng mô tả tùy chọn đăng nhập một lần cho bảng điều khiển.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

<!-- generated by src/lib/agentSkills/generator.ts; manual edits will be overwritten -->

Overview

Manage API key authentication and session tokens. Start here to authenticate requests via Bearer token, obtain session cookies, and configure login requirements for the OmniRoute API.

Authentication

Remote API requests use a Bearer credential. Dashboard login is different: POST /api/auth/login accepts a management password and returns an auth_token session cookie.

Endpoints

POST /api/auth/login

Authenticate user

curl -X POST http://localhost:20128/api/auth/login \
  -H "Content-Type: application/json" \
  -c cookie.jar \
  -d '{"password":"<management-password>"}'

POST /api/auth/logout

Log out

CSRF_TOKEN=$(curl -s http://localhost:20128/api/auth/csrf -b cookie.jar | jq -r .token)
curl -X POST http://localhost:20128/api/auth/logout \
  -b cookie.jar \
  -H "x-omniroute-csrf: $CSRF_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /api/auth/oidc/login

Start OIDC login for the dashboard admin gate

Builds an authorization URL from the configured OIDC issuer/client (discovered via {issuer}/.well-known/openid-configuration, falling back to {issuer}/authorize), sets a short-lived oidc_state cookie, and redirects the browser. Password login remains available as a fallback while OIDC is enabled.

curl http://localhost:20128/api/auth/oidc/login \
  -b cookie.jar

GET /api/auth/oidc/callback

Complete OIDC login for the dashboard admin gate

Validates the state cookie, exchanges the authorization code for tokens, verifies the ID token against the issuer's JWKS (audience = client id), and requires at least one dashboard admission policy: oidcAllowedSubjects (matching sub or verified email) or oidcAdmissionClaim (matching a configured array claim in the verified ID token). When both are present, both must match. Without either policy the callback returns not_configured. On success it mints the same 30-day auth_token dashboard-session JWT used by password login and redirects to /dashboard.

curl http://localhost:20128/api/auth/oidc/callback \
  -b cookie.jar

GET /api/auth/csrf

GET auth › csrf

curl http://localhost:20128/api/auth/csrf \
  -b cookie.jar

GET /api/auth/status

GET auth › status

curl http://localhost:20128/api/auth/status \
  -b cookie.jar

Payloads

See the full OpenAPI specification at GET /api/openapi/spec or docs/openapi.yaml for detailed request/response schemas.

<!-- skill:custom-start --> <!-- Migrated from skills/omniroute/SKILL.md (preserved curated content) -->

OmniRoute

Local/remote AI gateway exposing OpenAI-compatible REST. One key, 380 providers, auto-fallback, RTK token saver, MCP server, A2A agents.

Setup

export OMNIROUTE_URL="http://localhost:20128"      # or VPS / tunnel URL
export OMNIROUTE_KEY="sk-..."                       # from Dashboard → API Keys

All requests: ${OMNIROUTE_URL}/v1/... with Authorization: Bearer ${OMNIROUTE_KEY}.

Verify: curl $OMNIROUTE_URL/api/health → {"ok":true}

Discover models

curl $OMNIROUTE_URL/v1/models                  # chat/LLM (default)
curl $OMNIROUTE_URL/v1/models/image            # image-gen
curl $OMNIROUTE_URL/v1/models/tts              # text-to-speech
curl $OMNIROUTE_URL/v1/models/embedding        # embeddings
curl $OMNIROUTE_URL/v1/models/web              # web search + fetch
curl $OMNIROUTE_URL/v1/models/stt              # speech-to-text

Use data[].id as model field in requests. Combos appear with owned_by:"combo".

Capability skills

Capability Raw URL
Chat / code-gen https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omni-inference/SKILL.md
Image generation https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omni-inference/SKILL.md
Text-to-speech https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omni-inference/SKILL.md
Speech-to-text https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omni-inference/SKILL.md
Embeddings https://raw.githubuserconten
Câu hỏi thường gặp

Bearer token khác gì đăng nhập bảng điều khiển?

Yêu cầu API từ xa dùng một thông tin xác thực bearer, còn đăng nhập bảng điều khiển dùng mật khẩu quản trị và trả về session cookie.

Có hỗ trợ đăng nhập một lần không?

Có. Skill mô tả đăng nhập OIDC cho bảng điều khiển, và đăng nhập bằng mật khẩu vẫn được giữ làm phương án dự phòng.

Tôi có thể bỏ qua đăng nhập khi phát triển cục bộ không?

Skill nói yêu cầu xác thực có thể được tắt khi phát triển cục bộ.

Chi tiết

Mô tả gốc của tác giả

Manage API key authentication and session tokens. Start here to authenticate requests via Bearer token, obtain session cookies, and configure login requirements for the OmniRoute API.

repo: cheaper-inference/OmniRoute

Độ phổ biến

Sao GitHub
84k
Vị trí xếp hạng
#1420
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự