boruta client is an OAuth 2.0 client written in JavaScript/Typescript. It allows to interact with an OAuth 2.0 provider within javascript applications both on client and server sides.
This library gives the ability to follow the OAuth 2.0 flows. Here is the current state of what is implemented.
- client credentials
- implicit grant
- silent refresh impementation
- code grant
- resource owner password credentials grant
- introspect
- revoke
Installation can be performed with npm package manager from this repository (the code is to be released on the npm registry).
npm i https://github.com/malach-it/boruta-client.git
You have the ability to get tokens following the OAuth 2.0 client credentials flow as in the following example:
import { BorutaOauth } from 'boruta-client'
const oauth = new BorutaOauth({
host: 'https://oauth.provider',
tokenPath: '/oauth/token'
})
const client = new oauth.ClientCredentials({
clientId: 'shinyClientId',
clientSecret: 'shinyClientSecret'
})
client.getToken().then(console.log)
This product community follows the code of conduct available here
This code is released under the MIT license.