Chuyển đến nội dung
Skillpedia
Bảo mật8.1k · #12597

webiny-configure-okta

Skill này làm gì

Skill này hướng dẫn AI của bạn thiết lập Okta làm nhà cung cấp đăng nhập cho dự án Webiny. Skill dành cho lập trình viên có công ty dùng Okta để đăng nhập một lần.

Khi nào nên dùng

  • ✓Khi bạn muốn Okta thay Cognito để đăng nhập vào dự án Webiny.
  • ✓Khi các claim trong token Okta cần ánh xạ sang dữ liệu danh tính Webiny.
  • ✓Khi bạn cần đặt biến môi trường issuer và client ID của Okta.

Liên kết skill

https://github.com/webiny/webiny-js/blob/next/skills/user-skills/configure-okta/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/webiny/webiny-js/blob/next/skills/user-skills/configure-okta/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

“Chuyển dự án Webiny của chúng tôi sang đăng nhập Okta và ánh xạ claim email từ token Okta.”

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

Cách hoạt động

Skill giải thích cách cài gói Okta, viết một lớp cấu hình để ánh xạ claim của token, và thêm thành phần extension Okta vào file cấu hình. Issuer và client ID được đặt làm biến môi trường trước khi triển khai.

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.

Configure Okta Authentication

TL;DR

Webiny supports Okta as an external identity provider (IDP) to replace the default Cognito authentication. First, install the @webiny/okta package (using the same version as the webiny dependency in package.json). Then create two files: an API config class that maps Okta JWT claims to Webiny identity data (OktaIdpConfig), and a React extension component (<Okta />) that wires issuer URL, client ID, and the API config path. Register the extension in webiny.config.tsx, set two environment variables (OKTA_ISSUER, OKTA_CLIENT_ID), and deploy.

Pattern / Core Concept

Okta integration has two parts:

  1. API Config — A class implementing OktaIdpConfig.Interface that maps JWT token claims to Webiny's identity structure. Registered via OktaIdpConfig.createImplementation() (the universal DI pattern).
  2. Extension Component — A React component that renders <Okta /> from @webiny/okta, passing the issuer URL, client ID, and path to the API config file. The <Okta /> component handles environment variable injection, API extension registration, and Admin login screen setup automatically.

How <Okta /> Works Internally

The <Okta /> component (from @webiny/okta) is a defineExtension that:

  • Sets Lambda env vars: OKTA_ISSUER, OKTA_CLIENT_ID
  • Sets Admin app env vars: REACT_APP_IDP_TYPE=okta, REACT_APP_OKTA_ISSUER, REACT_APP_OKTA_CLIENT_ID
  • Registers the internal OktaIdpFeature API extension (OIDC token verification)
  • Registers your custom API config extension (identity mapping)
  • Registers the Admin Okta login screen extension

Reference Tables

OktaIdpConfig.Interface

Method Signature Required Description
getIdentity (token: JwtPayload) => OktaIdentity | Promise<OktaIdentity> Yes Maps JWT claims to Webiny identity data
verifyTokenClaims (token: JwtPayload) => void | Promise<void> No Custom claim verification (throw to reject the token)

OktaIdentity (Return Type of getIdentity)

Field Type Description
id string Unique user ID (typically token["sub"])
displayName string User's display name
roles string[] Webiny security roles to assign
teams string[] Webiny teams (optional, filter out falsy values)
profile { firstName, lastName, email } User profile fields
context object Runtime data (not stored in DB)

<Okta /> Component Props

Prop Type Description
issuer string Okta issuer URL (e.g., https://dev-xxx.okta.com)
clientId string Okta application client ID
apiConfig string Absolute path to the API config file

Environment Variables

Variable Used By Description
OKTA_ISSUER API + Admin Okta issuer URL
OKTA_CLIENT_ID API + Admin Okta application client ID

Full Examples

Example 1: Basic Okta Configuration

Step 0: Install the @webiny/okta dependency

@webiny/okta is an optional dependency. Add it to package.json using the same version as the webiny dependency, then install:

# Check the webiny version in package.json, then add @webiny/okta with the same version
# For example, if "webiny": "^0.0.0-unstable.xxx":
yarn add @webiny/okta@^0.0.0-unstable.xxx

Important: After adding the dependency, tell the user to run yarn to install it. Do NOT run yarn automatically — let the user do it.

Câu hỏi thường gặp

Những biến môi trường nào được dùng?

OKTA_ISSUER và OKTA_CLIENT_ID.

Okta có thay thế Cognito không?

Có. Skill mô tả Okta là sự thay thế cho xác thực Cognito mặc định.

Có thể tùy chỉnh luồng đăng nhập không?

Có. Skill nhắc đến việc tùy chỉnh luồng đăng nhập Okta.

Chi tiết

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

Configuring Okta as an identity provider (IDP) for Webiny projects. Use this skill when the developer asks about Okta authentication, Okta SSO, replacing Cognito with Okta, setting up external identity providers, configuring OIDC authentication, mapping JWT claims to Webiny identities, or customizing the Okta login flow. Also relevant when asking about OKTA_ISSUER, OKTA_CLIENT_ID environment variables, OktaIdpConfig, or the MyOktaExtension pattern.

repo: webiny/webiny-js

Độ phổ biến

Sao GitHub
8.1k
Vị trí xếp hạng
#12597
Giấy phép
—
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ự