ivy-create-auth-connection
Add an authentication provider to an existing Ivy project. This skill guides you through selecting a provider, collecting the required credentials, and configuring the project.
Pre-flight: Read Learnings
If the file .ivy/learnings/ivy-create-auth-connection.md exists in the project directory, read it first and apply any lessons learned from previous runs of this skill.
Reference Files
Read before implementing:
- references/AGENTS.md -- Ivy framework API reference (widgets, hooks, layouts, inputs, colors)
Step 1: Validate the Project
- Verify this is a valid Ivy project. Check for a
.csproj file and Program.cs in the working directory. If this is not an Ivy project, tell the user and stop.
Step 2: Choose an Auth Provider
- If the user has not already specified a provider, ask them to choose one from the supported list:
| Provider |
Description |
Required Secrets |
| Basic |
Simple username/password auth with JWT tokens. Good for internal tools or prototyping. |
Users, HashSecret, JwtSecret, JwtIssuer, JwtAudience |
| Auth0 |
Enterprise-grade identity platform with social logins, MFA, and SSO. |
Domain, ClientId, ClientSecret, Audience, Namespace |
| Supabase |
Open-source Firebase alternative with built-in auth. Supports email/password, social logins, and SSO via WorkOS. |
Url, ApiKey, LegacyJwtSecret |
| Clerk |
Modern authentication with prebuilt UI components and session management. |
PublishableKey, SecretKey |
| GitHub |
GitHub OAuth for developer-facing applications. |
ClientId, ClientSecret, RedirectUri |
| Authelia |
Self-hosted single sign-on and 2FA server. |
Url |
| Microsoft Entra |
Azure Active Directory / Microsoft Entra ID for enterprise SSO. |
TenantId, ClientId, ClientSecret |
Step 3: Collect Provider-Specific Credentials
- Based on the chosen provider, collect the required credentials from the user. Each provider requires different configuration values:
Basic Auth (JWT)
- Ask the user for initial user credentials (username:password pairs, comma-separated)
- Ask for a JWT issuer name (default: the project name)
- Ask for a JWT audience name (default: the project name)
- A hash secret and JWT secret are auto-generated
Auth0
- Ask for the Auth0 Domain (e.g.
your-tenant.auth0.com)
- Ask for the Client ID from the Auth0 application
- Ask for the Client Secret from the Auth0 application
- Ask for the API Audience (e.g.
https://your-api.example.com)
- Optionally, Auth0 supports additional options like role-based access control and custom claims
Supabase
- Ask for the Supabase project URL (e.g.
https://your-project.supabase.co)
- Ask for the Supabase anon/public API key
- Optionally, ask for the legacy JWT secret (for direct JWT verification)
- Supabase supports additional options like WorkOS SSO integration
Clerk
- Ask for the Clerk Publishable Key (starts with
pk_)
- Ask for the Clerk Secret Key (starts with
sk_)
- Clerk supports additional options like organization-based access
GitHub OAuth
- Ask for the GitHub OAuth App Client ID
- Ask for the GitHub OAuth App Client Secret
- Ask for the Redirect URI (e.g.
https://localhost:5001/callback)
Authelia
- Ask for the Authelia instance URL (e.g.
https://auth.example.com)
Microsoft Entra ID
- Ask for the Tenant ID
- Ask for the Application (Client) ID
- Ask for the Client Secret
Step 4: Generate the Auth Configuration
The auth provider setup involves:
- Adding the required NuGet package for the provider
- Storing secrets in dotnet user secrets (with the provider-specific prefix)
- Updating
Program.cs with server.UseAuth<[ProviderClassName]>()
Initialize user secrets for the project:
dotnet user-secrets init
- Set each required secret using
dotnet user-secrets set. For example:
dotnet user-secrets set "Auth0:Domain" "your-tenant.auth0.com"
dotnet user-secrets set "Auth0:ClientId" "your-client-id"
- Consult the specific auth provider documentation (via
https://docs.ivy.app/sitemap.xml or documentation markdown endpoints) if you need details about the NuGet package name, the provider class name, or the Program.cs registration pattern for the chosen provider.
Step 5: Verify
Run dotnet build to verify everything compiles. Fix any errors.
If the project is in a git repository, create a commit with a descriptive message, for example: "Added [ProviderDisplayName] authentication."
Tell the user the auth provider is ready and summarize what was configured:
- Auth provider package added
- Secrets stored with the provider prefix
- Program.cs updated with the auth registration
Recovery
If the setup fails:
Diagnose the root cause (invalid credentials, auth provider not configured, network issues):
- For invalid credentials: verify API keys, tokens, or OAuth client credentials are correct
- For provider config issues: check that the auth provider is registered in the app's configuration
- For network issues: verify the auth provider endpoint is accessible
After fixing the underlying issue, either retry using the /ivy-create-auth-connection skill from scratch, or manually create the auth provider class and register it in Program.cs.
Consult the provider documentation endpoints for provider-specific guidance.
Post-run: Evaluate and Improve
After completing the task:
- Evaluate: Did the build succeed? Were there compilation errors, unexpected behavior, or manual corrections needed during this run?
- Update learnings: If anything required correction or was surprising, append a concise entry to
.ivy/learnings/ivy-create-auth-connection.md (create the file and .ivy/learnings/ directory if they don't exist). Each entry should note: the date, what went wrong, why, and what to do differently next time.
- Skip if clean: If everything succeeded without issues, do not update the learnings file.
1---2name: ivy-create-auth-connection3description: Add an authentication provider to an Ivy project. Supports Basic Auth (JWT), Auth0, Supabase, Clerk, GitHub OAuth, Authelia, and Microsoft Entra ID. Use when the user wants to add login, authentication, or identity to their project.4---56# ivy-create-auth-connection78Add an authentication provider to an existing Ivy project. This skill guides you through selecting a provider, collecting the required credentials, and configuring the project.910## Pre-flight: Read Learnings1112If the file `.ivy/learnings/ivy-create-auth-connection.md` exists in the project directory, read it first and apply any lessons learned from previous runs of this skill.1314## Reference Files1516Read before implementing:17- [references/AGENTS.md](references/AGENTS.md) -- Ivy framework API reference (widgets, hooks, layouts, inputs, colors)1819## Step 1: Validate the Project20211. Verify this is a valid Ivy project. Check for a `.csproj` file and `Program.cs` in the working directory. If this is not an Ivy project, tell the user and stop.2223## Step 2: Choose an Auth Provider24252. If the user has not already specified a provider, ask them to choose one from the supported list:2627| Provider | Description | Required Secrets |28|---|---|---|29| **Basic** | Simple username/password auth with JWT tokens. Good for internal tools or prototyping. | Users, HashSecret, JwtSecret, JwtIssuer, JwtAudience |30| **Auth0** | Enterprise-grade identity platform with social logins, MFA, and SSO. | Domain, ClientId, ClientSecret, Audience, Namespace |31| **Supabase** | Open-source Firebase alternative with built-in auth. Supports email/password, social logins, and SSO via WorkOS. | Url, ApiKey, LegacyJwtSecret |32| **Clerk** | Modern authentication with prebuilt UI components and session management. | PublishableKey, SecretKey |33| **GitHub** | GitHub OAuth for developer-facing applications. | ClientId, ClientSecret, RedirectUri |34| **Authelia** | Self-hosted single sign-on and 2FA server. | Url |35| **Microsoft Entra** | Azure Active Directory / Microsoft Entra ID for enterprise SSO. | TenantId, ClientId, ClientSecret |3637## Step 3: Collect Provider-Specific Credentials38393. Based on the chosen provider, collect the required credentials from the user. Each provider requires different configuration values:4041### Basic Auth (JWT)42- Ask the user for initial user credentials (username:password pairs, comma-separated)43- Ask for a JWT issuer name (default: the project name)44- Ask for a JWT audience name (default: the project name)45- A hash secret and JWT secret are auto-generated4647### Auth048- Ask for the Auth0 Domain (e.g. `your-tenant.auth0.com`)49- Ask for the Client ID from the Auth0 application50- Ask for the Client Secret from the Auth0 application51- Ask for the API Audience (e.g. `https://your-api.example.com`)52- Optionally, Auth0 supports additional options like role-based access control and custom claims5354### Supabase55- Ask for the Supabase project URL (e.g. `https://your-project.supabase.co`)56- Ask for the Supabase anon/public API key57- Optionally, ask for the legacy JWT secret (for direct JWT verification)58- Supabase supports additional options like WorkOS SSO integration5960### Clerk61- Ask for the Clerk Publishable Key (starts with `pk_`)62- Ask for the Clerk Secret Key (starts with `sk_`)63- Clerk supports additional options like organization-based access6465### GitHub OAuth66- Ask for the GitHub OAuth App Client ID67- Ask for the GitHub OAuth App Client Secret68- Ask for the Redirect URI (e.g. `https://localhost:5001/callback`)6970### Authelia71- Ask for the Authelia instance URL (e.g. `https://auth.example.com`)7273### Microsoft Entra ID74- Ask for the Tenant ID75- Ask for the Application (Client) ID76- Ask for the Client Secret7778## Step 4: Generate the Auth Configuration79804. The auth provider setup involves:81 - Adding the required NuGet package for the provider82 - Storing secrets in dotnet user secrets (with the provider-specific prefix)83 - Updating `Program.cs` with `server.UseAuth<[ProviderClassName]>()`84855. Initialize user secrets for the project:8687```bash88dotnet user-secrets init89```90916. Set each required secret using `dotnet user-secrets set`. For example:9293```bash94dotnet user-secrets set "Auth0:Domain" "your-tenant.auth0.com"95dotnet user-secrets set "Auth0:ClientId" "your-client-id"96```97987. Consult the specific auth provider documentation (via `https://docs.ivy.app/sitemap.xml` or documentation markdown endpoints) if you need details about the NuGet package name, the provider class name, or the `Program.cs` registration pattern for the chosen provider.99100## Step 5: Verify1011028. Run `dotnet build` to verify everything compiles. Fix any errors.1031049. If the project is in a git repository, create a commit with a descriptive message, for example: "Added [ProviderDisplayName] authentication."10510610. Tell the user the auth provider is ready and summarize what was configured:107 - Auth provider package added108 - Secrets stored with the provider prefix109 - Program.cs updated with the auth registration110111## Recovery112113If the setup fails:1141151. Diagnose the root cause (invalid credentials, auth provider not configured, network issues):116 - For invalid credentials: verify API keys, tokens, or OAuth client credentials are correct117 - For provider config issues: check that the auth provider is registered in the app's configuration118 - For network issues: verify the auth provider endpoint is accessible1191202. After fixing the underlying issue, either retry using the `/ivy-create-auth-connection` skill from scratch, or manually create the auth provider class and register it in `Program.cs`.1211223. Consult the provider documentation endpoints for provider-specific guidance.123124## Post-run: Evaluate and Improve125126After completing the task:1271281. **Evaluate**: Did the build succeed? Were there compilation errors, unexpected behavior, or manual corrections needed during this run?1292. **Update learnings**: If anything required correction or was surprising, append a concise entry to `.ivy/learnings/ivy-create-auth-connection.md` (create the file and `.ivy/learnings/` directory if they don't exist). Each entry should note: the date, what went wrong, why, and what to do differently next time.1303. **Skip if clean**: If everything succeeded without issues, do not update the learnings file.