Angular 2/4 Authentication
This package provides major missing feature in angular2: Authentication.
Package is given in completely 100% pure TypeScript.
Package is strictly dependent on sibling
ng4-httpmodule, so make sure to use it as http module (it's actually imported already in
Authentication modules provides ability to attach authentication token automatically to the headers (through http interceptors), refresh token functionality, guards for protected or public pages and more.
AuthServiceinterface to implement it with your custom Authentication service, e.g.:
PublicGuardfor public routes and
ProtectedGuardfor protected respectively, e.g.:
- Create additional
AuthenticationModuleand provide important providers and imports, e.g.:
PROTECTED_FALLBACK_PAGE_URI - main protected page to be redirected to, in case if user will reach public route, that is protected
PublicGuard and will be authenticated
PUBLIC_FALLBACK_PAGE_URI- main public page to be redirected to, in case if user will reach protected route, that is protected by
ProtectedGuardand won't be authenticated
AUTH_SERVICE- Authentication service token providers
- Provide your