NgxOauth2Client
Simple package to manage OAuth2 authentication in the angular client side. For now only password flow is supported.
To start, install it:
#package installation npm install ngx-oauth2-client
Feature
The service is a singleton, so is possible to use authentication information/functionality from everywhere.
The package save by default information in the cookie, so it's not necessary login every page refresh.
For now the only one provided flow are password
- login(username, password)
- login from cookie
- logout
How to use
It's necessary configure the login/logout end-point.
Oauth2Service.setUrl'auth.example.com';
This is an example of the main usage of the package
OAuth2Service.setUrl'http://example.com';if oauth2.loginFromCookie else