electron-oauthorize
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)
}