0.3.2 • Published 8 years ago

electron-oauthorize v0.3.2

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

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)
}
0.3.2

8 years ago

0.3.1

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago