Skip to content

davidcsz/oauth2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OAuth2

Promise based OAuth 2.0 library.

Functions

  • formAuthorzationUri
    • Returns a Promise that resolves to a complete authorization URL that you can redirect to.
    • Accepts an object in the following format:
{
    client: {
        id: 'SOME-CLIENT-ID',
        secret: 'SOME-SECRET'
    },
    uri: {
        authorization: 'https://someoauth.com/auth',
        token: 'https://someoauth.com/token'
        redirect: 'https://mywonderfulapp.com'
    },
    scope: 'SOME SCOPE HERE',
    responseType: 'RESPONSE-TYPE-IF-ANY'
}
  • getAccessToken
    • Returns a Promise that resolves to an object containing the response from the token request.
    • Accepts an object in the following format:
{
    client: {
        id: 'SOME-CLIENT-ID',
        secret: 'SOME-SECRET'
    },
    uri: {
        authorization: 'https://someoauth.com/auth',
        token: 'https://someoauth.com/token'
        redirect: 'https://mywonderfulapp.com'
    },
    scope: 'SOME SCOPE HERE',
    code: 'AUTHORIZATION-CODE'
}

About

OAuth 2.0 through Node

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published