the Repository reference for the Authentication. The service will read its configuration and use its HttpProvider
the Repository reference for the Authentication. The service will read its configuration and use its HttpProvider
The private subject for tracking the login state
Gets the current state of the service
Returns the current user's name as a string. In case of unauthenticated users, it will return 'BuiltIn\Visitor'
This observable indicates the current state of the service
Executed before each Ajax call. If the access token has been expired, but the refresh token is still valid, it triggers the token refreshing call
An observable with a variable that indicates if there was a refresh triggered.
Gets the specified OAuth provider instance
The provider type to be retrieved
It is possible to send authentication requests using this action. You provide the username and password and will get the User object as the response if the login operation was successful or HTTP 403 Forbidden message if it wasn’t. If the username does not contain a domain prefix, the configured default domain will be used. After you logged in the user successfully, you will receive a standard ASP.NET auth cookie which will make sure that your subsequent requests will be authorized correctly.
The username and password is sent in clear text, always send these kinds of requests through HTTPS.
Name of the user.
Password of the user.
Returns an RxJS observable that you can subscribe of in your code.
let userLogin = service.Login('alba', 'alba');
userLogin.subscribe({
next: response => {
console.log('Login success', response);
},
error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
complete: () => console.log('done'),
});
Logs out the current user, sets the tokens to 'empty' and sends a Logout request to invalidate all Http only cookies
An Observable that will be updated with the logout response
Sets a specified OAuth provider
The provider instance to be set
Generated using TypeDoc
This service class manages the JWT authentication, the session and the current login state.