Skip to content

turuturu/oauth-js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Installation

In the <head> of your HTML, include OAuth.js

<script src="/path/to/OAuth.js"></script>

In your Javascript, add this line to initialize OAuth.js

OAuth.initialize('Public key');

Usage

To connect your user using facebook, 2 methods:

Mode popup

//Using popup (option 1)
OAuth.popup('facebook', function(err, result) {
 //handle error with err
 //use result.access_token in your API request
});

Mode redirection

//Using redirection (option 2)
OAuth.redirect('facebook', "callback/url");

In callback url :

OAuth.callback('facebook', function(err, result) {
 //handle error with err
 //use result.access_token in your API request
});

More information in oauth.io documentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published