mapzen/electron-auth

Name: electron-auth

Owner: Mapzen

Description: A dead simple electron library to handle the OAuth authentication for some providers

Forked from: jmjuanes/electron-auth

Created: 2017-06-06 17:16:46.0

Updated: 2017-06-06 17:16:48.0

Pushed: 2017-04-13 17:23:58.0

Homepage: https://www.npmjs.com/package/electron-auth

Size: 9

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

electron-auth

npm npm npm

A dead simple electron library to handle the OAuth authentication for some providers

NOTE: More authorization providers and documentation are in progress. Interested in contribute? You are welcome :smile:

Installation
install --save electron-auth
Usage
port dependencies
app = require('electron').app;
auth = require('electron-auth');

itialize the application
on('ready', function()

Initialize the github auth options
r opt = { client_id: 'YOUR_CLIENT_ID', client_secret: 'YOUR_CLIENT_SECRET' };

Handle the github authentication
turn auth(auth.providers.github, opt, function(error, token)

//Do your magic with the token 
//....
;

API
auth(provider, options, callback)

Perform the user authentication for the desired provider. This method accepts the following arguments:

Providers

All the supported providers are stored in auth.providers.PROVIDER_NAME. You can also use your own provider.

GitHub

Read more about the GitHub Authentication: https://developer.github.com/v3/oauth/

Related
License

MIT LICENSE © Josemi Juanes.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.