tcomad-oidc v4.2.4
Authenticate users with OpenID Connect authentication service (f.e. Keycloak) in browser, Electron, or Capacitor app
Main features:
- TypeScript support
- ESModule support
- Working with React, Angular and other popular front-end libraries
- Working in browser, Electron and Capacitor applications
- Logging user in using redirect to the auth service
- Getting user info claims
- Supplying access token for requests to the back-end
- Automatic refreshing of the access token with refresh token when it expires
- Logging user out from the application and from the auth service
How to use
1. Install library using npm
2. Import AuthService
3. Initialize AuthService
Config object fields: 1. authority: URL to the authentication service (f.e. http://[host]/realms/[realm-name]) 2. clientId: ID of the application registered within authentication service 3. (OPTIONAL) errorHandler: callback function that will be called in case of auth errors Defaults to (error) => console.log(error) 4. (OPTIONAL) autoLogin: Determines whether authentication should start automatically when page loaded Defaults to false 5. (OPTIONAL) electronRedirectUrl: URL which must be used to return user to Electron app Will only be used if Electron context detected Defaults to "http://localhost/" 6. (OPTIONAL) capacitorRedirectUrl: URL which must be used to return user to Capacitor app Will only be used if Capacitor context detected Defaults to http://localhost/"
4. Start login
Login will be started automatically if it was configured to do so, if no, you can start it by
5. Check login status
You can check login status with
6. Get user info claims
To get user info claim you can use
7. Get access token to make requests
You can get user access token with
8. Force refresh
You can force lib to refresh tokens and user info with:
9. Logout user
You can log out user from your application and authentication service with
Copyright
Released under the MIT License. See the LICENSE file.
2 months ago
11 months ago
11 months ago
11 months ago
8 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago