ng-auth-gen-ai
is an npm package that facilitates the streamlined setup of authentication flow within Angular applications using intelligent automation. Leveraging Azure AD, ng-auth-gen-ai
simplifies the integration of authentication functionality into Angular projects. It comes with pre-configured pages, routing, and guards, enabling users to authenticate seamlessly.
-
Automated Setup: Quickly establish authentication flow within Angular applications with minimal manual configuration.
-
Intelligent Configuration:
ng-auth-gen-ai
intelligently configures authentication pages, routes, and guards based on best practices and common use cases. -
Customizable: Tailor authentication pages and configurations to meet the specific requirements of your application.
-
Easy Integration: Seamlessly integrate
ng-auth-gen-ai
into existing or new Angular projects with straightforward installation and usage.
Before setting up authentication with ng-auth-gen-ai
, ensure the following prerequisites are met:
-
Azure App Registration: You must have created an app registration within Azure. Update the placeholders within the
security/auth.config.ts
file with your tenant id and client id obtained from the Azure portal. -
Redirect URIs: Add the following URIs under Redirect URIs for a Single Page Application platform in your Azure App Registration:
http://localhost:4200/home
http://localhost:4200/login
-
Angular Routing: Ensure that your Angular application is set up with routing using
@angular/router
.ng-auth-gen-ai
relies on Angular routing to navigate between authentication-related pages. -
SCSS Styling: Ensure that your Angular application is using SCSS for component stylings.
ng-auth-gen-ai
relies on SCSS for styling customization.
To install ng-auth-gen-ai
, use npm:
npm install ng-auth-gen-ai --save-dev
After installation, follow these steps to set up authentication:
-
Add the following script to the
package.json
under the scripts section:"setup-auth": "node node_modules/ng-auth-gen-ai/scripts/setup-auth.js"
-
Execute the following command:
npm run setup-auth
This will initiate the setup process, utilizing Azure AD for authentication configuration.