crds-angular-auth-wrapper-lib
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

AuthLib

This library was generated with Angular CLI version 8.2.11.

Purpose: The Auth service provides four main components. The only "required" component is AuthService, as the others depend on it.

  1. AuthService: Has an authenticated() method which checks local storage for the presence of authentication cookies, calls Okta with the cookies, and returns the cookie if they are valid. Note that this service will automatically refresh the sessionId cookie if a refresh token is present

  2. LoggedInGuard: Will prevent a route from being navigated to if the user doesn't have valid cookies set. Will redirect to the login page instead.

  3. ManageCookiesInterceptorService: This is Angular middleware which will set the Crds auth cookies on every request.

  4. ReactiveAuthService: Will redirect the user to the login page if the auth cookie is expired or deleted.

Code scaffolding

Run ng generate component component-name --project auth-lib to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project auth-lib.

Note: Don't forget to add --project auth-lib or else it will be added to the default project in your angular.json file.

Build

Run ng build auth-lib to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build auth-lib, go to the dist folder cd dist/auth-lib and run npm publish.

Running unit tests

Run ng test auth-lib to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

Readme

Keywords

none

Package Sidebar

Install

npm i crds-angular-auth-wrapper-lib

Weekly Downloads

3

Version

0.0.1

License

none

Unpacked Size

297 kB

Total Files

47

Last publish

Collaborators

  • crds_npm_org