OverviewHistoryStatsSecurity
npx skills add ...
Documentation
SKILL.md
npx skills add auth0/agent-skills --skill auth0-angular
Use when adding Auth0 login, logout, route guards, or HTTP interceptors to an Angular application. Integrates @auth0/auth0-angular for SPAs — use even if the user says "protect my Angular routes" or "add authentication to Angular" without naming the SDK.
npx skills add auth0/agent-skills --skill auth0-angular
Add authentication to Angular applications using @auth0/auth0-angular.
auth0-quickstart skill firstauth0-react-native for React Native or native SDKs for IonicFor automated setup with Auth0 CLI, see Setup Guide [blocked] for complete scripts.
For manual setup:
Update src/environments/environment.ts:
For standalone components (Angular 14+):
Update src/app/app.config.ts:
For NgModule-based apps:
Update src/app/app.module.ts:
Update src/app/app.component.ts:
Start your dev server and test the login flow:
| Mistake | Fix |
|---|---|
| Forgot to add redirect URI in Auth0 Dashboard | Add your application URL (e.g., http://localhost:4200, https://app.example.com) to Allowed Callback URLs in Auth0 Dashboard |
| Not configuring AuthModule properly | Must call AuthModule.forRoot() in NgModule or provideAuth0() in standalone config |
| Accessing auth before initialization | Use isLoading$ observable to wait for SDK initialization |
| Storing tokens manually | Never manually store tokens - SDK handles secure storage automatically |
| No token sent to API | Use either authHttpInterceptorFn for automatic token attachment, or getAccessTokenSilently() for manual control — see Integration Guide [blocked] |
| Route guard not protecting routes | Apply AuthGuard (or authGuardFn) to protected routes in routing config |
auth0-quickstart - Basic Auth0 setupauth0-migration - Migrate from another auth providerauth0-mfa - Add Multi-Factor Authenticationauth0-cli - Manage Auth0 resources from the terminalCore Services:
AuthService - Main authentication serviceisAuthenticated$ - Observable check if user is logged inuser$ - Observable user profile informationloginWithRedirect() - Initiate loginlogout() - Log out usergetAccessTokenSilently() - Get access token manually (alternative to HTTP interceptor)Common Use Cases: