Pet Adoption System
This is the sample project for the Auth0 blog post Create Your First Custom Schematic with Nx.
Quick Start & Documentation
Generate your first application
ng generate app myapp to generate an application. When using Nx, you can create multiple applications and libraries in the same CLI workspace. Read more here.
ng serve --project=myapp for a dev server. Navigate to
http://localhost:4200/. The app will automatically reload if you change any of the source files.
ng generate component component-name --project=myapp to generate a new component. You can also use
ng generate directive|pipe|service|class|guard|interface|enum|module.
ng build --project=myapp to build the project. The build artifacts will be stored in the
dist/ directory. Use the
--prod flag for a production build.
Running unit tests
ng test to execute the unit tests via Karma.
Running end-to-end tests
ng e2e to execute the end-to-end tests via Protractor.
Before running the tests make sure you are serving the app via
To get more help on the Angular CLI use
ng help or go check out the Angular CLI README.
Using Auth0 for Authentication
We recommend using Auth0 to manage authentication for this project.
Sign Up for Auth0
Set Up an Application
Once you've got your account, you can set up an application to use with this project. We'll set up a Single Page Application (SPA) in Auth0 in these steps.
Here's how to set that up:
- Go to your Auth0 Applications and click the "Create Application" button.
- Name your new app, select "Single Page Web Applications," and click the "Create" button. You can skip the Quick Start and click on Settings.
- In the Settings for your new Auth0 app, add
http://localhost:4200/callbackto the Allowed Callback URLs. (We're using
localhost:4200since it's the default port for the Angular CLI
http://localhost:4200to the Allowed Logout URLs.
- Click the "Save Changes" button.
- Copy down your Domain and Client ID. We'll use them in just a minute.
- If you'd like, you can set up some social connections. You can then enable them for your app in the Application options under the Connections tab. The example shown in the screenshot above utilizes username/password database, Facebook, Google, and Twitter.
Note: Under the OAuth tab of Advanced Settings (at the bottom of the Settings section) you should see that the JsonWebToken Signature Algorithm is set to
RS256. This is the default for new applications. If it is set to
HS256, please change it to
RS256. You can read more about RS256 vs. HS256 JWT signing algorithms here.
What is Auth0?
Auth0 helps you to:
- Add authentication with multiple authentication sources, either social like Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce, amont others, or enterprise identity systems like Windows Azure AD, Google Apps, Active Directory, ADFS or any SAML Identity Provider.
- Add authentication through more traditional username/password databases.
- Add support for linking different user accounts with the same user.
- Support for generating signed Json Web Tokens to call your APIs and flow the user identity securely.
- Analytics of how, when and where users are logging in.
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
This project is licensed under the MIT license. See the LICENSE file for more info.