本文へスキップ
Skillpedia
セキュリティ8.1k · #12595

webiny-configure-auth0

できること

このスキルは、WebinyプロジェクトのログインプロバイダーとしてAuth0を設定する手順をAIに示します。デフォルトのCognitoサインインの代わりにAuth0を使いたい開発者向けです。

使う場面

  • ✓Webinyプロジェクトへのサインインに、CognitoをAuth0に置き換えたいとき。
  • ✓Auth0のJWTクレームを、Webinyのアイデンティティのデータにマッピングする必要があるとき。
  • ✓Auth0のissuerとクライアントIDの環境変数を設定する必要があるとき。

スキルのリンク

https://github.com/webiny/webiny-js/blob/next/skills/user-skills/configure-auth0/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/webiny/webiny-js/blob/next/skills/user-skills/configure-auth0/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“WebinyプロジェクトのCognitoログインをAuth0に置き換え、トークンからユーザーのメールアドレスをマッピングしてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

スキルは、Auth0パッケージのインストール、クレームをマッピングする設定クラスの作成、設定ファイルへのAuth0の拡張コンポーネントの追加を説明します。デプロイの前に、issuerとクライアントIDを環境変数として設定します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Configure Auth0 Authentication

TL;DR

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

Pattern / Core Concept

Auth0 integration has two parts:

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

How <Auth0 /> Works Internally

The <Auth0 /> component (from @webiny/auth0) is a defineExtension that:

  • Sets Lambda env vars: AUTH0_ISSUER, AUTH0_CLIENT_ID
  • Sets Admin app env vars: REACT_APP_IDP_TYPE=auth0, REACT_APP_AUTH0_ISSUER, REACT_APP_AUTH0_CLIENT_ID
  • Registers the internal Auth0IdpFeature API extension (OIDC token verification)
  • Registers your custom API config extension (identity mapping)
  • Registers the Admin Auth0 login screen extension

Reference Tables

Auth0IdpConfig.Interface

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

Auth0Identity (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)

<Auth0 /> Component Props

Prop Type Description
issuer string Auth0 issuer URL (e.g., https://your-tenant.auth0.com)
clientId string Auth0 application client ID
apiConfig string Absolute path to the API config file

Environment Variables

Variable Used By Description
AUTH0_ISSUER API + Admin Auth0 issuer URL
AUTH0_CLIENT_ID API + Admin Auth0 application client ID

Full Examples

Example 1: Basic Auth0 Configuration

Step 0: Install the @webiny/auth0 dependency

@webiny/auth0 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/auth0 with the same version
# For example, if "webiny": "^0.0.0-unstable.xxx":
yarn add @webiny/auth0@^0.0.0-unstable.xxx

Important: After adding the dependency, tell the user to r

よくある質問

どの環境変数が必要ですか?

issuerのURLとクライアントIDで、AUTH0_ISSUERとAUTH0_CLIENT_IDという名前です。

Auth0はCognitoを完全に置き換えますか?

はい。スキルは、Auth0をデフォルトのCognito認証の代わりとして説明しています。

パッケージのバージョンは何に合わせる必要がありますか?

package.jsonにあるwebinyの依存関係と同じバージョンです。

詳細

作者による元の説明

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

repo: webiny/webiny-js

人気

GitHubのスター
8.1k
ランキング
#12595
ライセンス
—
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル