Skip to content

Instantly share code, notes, and snippets.

@simistern
Created November 20, 2020 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simistern/568323355aa4b9b7191e44f3ddab9c1f to your computer and use it in GitHub Desktop.
Save simistern/568323355aa4b9b7191e44f3ddab9c1f to your computer and use it in GitHub Desktop.
import { Client, oauth2 } from 'ketting';
const client = new Client('api.example.org');
client.use(oauth2({
grantType: 'password',
clientId: 'fooClient',
clientSecret: 'barSecret',
tokenEndpointUri: 'https://api.example.org/oauth/token',
scopes: ['test']
userName: 'fooOwner',
password: 'barPassword'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment