@kronos-integration/service-authenticator
Version:
authentication providing service
69 lines (43 loc) • 3.19 kB
Markdown
[](https://spdx.org/licenses/0BSD.html)
[](https://github.com/Kronos-Integration/service-authenticator/issues)
[](https://actions-badge.atrox.dev/Kronos-Integration/service-authenticator/goto)
[](https://github.com/prettier/prettier)
[](http://commitizen.github.io/cz-cli/)
[](https://snyk.io/test/github/Kronos-Integration/service-authenticator)
[](https://coveralls.io/github/Kronos-Integration/service-authenticator)
# @kronos-integration/service-authentication
authentication providing service
# usage
# API
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
### Table of Contents
* [JWTResponse](#jwtresponse)
* [Properties](#properties)
* [ServiceAuthenticator](#serviceauthenticator)
* [changePasswordEndpoints](#changepasswordendpoints)
* [authEndpoints](#authendpoints)
* [accessTokenGenerator](#accesstokengenerator)
* [Parameters](#parameters)
* [name](#name)
## JWTResponse
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
### Properties
* `access_token` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
* `refresh_token` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
* `token_type` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** always "Bearer"
* `expires_in` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** seconds the access token is valid
## ServiceAuthenticator
**Extends Service**
### changePasswordEndpoints
Endpoints used to send password change requests to.
### authEndpoints
Endpoints used to send authentication requests to.
### accessTokenGenerator
Generate a request handler to deliver JWT access tokens.
#### Parameters
* `credentials` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
* `credentials.username` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
* `credentials.password` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
Returns **[JWTResponse](#jwtresponse)** jwt
### name
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 'authenticator'