malach-it / boruta-client

OAuth 2.0 client written in TypeScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

logo-yellow

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.

Implementation

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

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

Usage

Client credentials

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)

Code of Conduct

This product community follows the code of conduct available here

License

This code is released under the MIT license.

About

OAuth 2.0 client written in TypeScript

License:MIT License


Languages

Language:TypeScript 100.0%