Miss any of our Open RFC calls?Watch the recordings here! »

This package has been deprecated

Author message:

This project is no longer maintained

electron-oauthorize

0.3.2 • Public • Published

electron-oauthorize

npm License Docs

OAuth application authorization wrapped for Electron

Tested / With presets for:

  • Twitter OAuth 1.0A
  • Tumblr OAuth 1.0A
  • SoundCloud OAuth 2
  • DeviantArt OAuth 2

Usage Example

const electronOAuthorize = require('electron-oauthorize')

let options = electronOAuthorize.getPreset('soundcloud')
    options.client_id     = 'soundcloud_client_id'
    options.client_secret = 'soundcloud_client_secret'
    options.scope         = 'non-expiring'
    options.access_type   = null

let window_options = {
    width            : 450,
    height           : 626,
    parent           : BrowserWindow.fromId(1),
    modal            : true,
    show             : false,
    fullscreenable   : false,
    maximizable      : false,
    minimizable      : false,
}

let authorization = new electronOAuthorize.OAuth2(options, window_options)
    .then(authSuccess, authFailure)

function authSuccess(result) {
  // result.access_token, result.refresh_token
}

function authFailure(error) {
  // console.log(error.message)
}

Install

npm i electron-oauthorize

DownloadsWeekly Downloads

2

Version

0.3.2

License

MIT

Last publish

Collaborators