8000 GitHub - kingwjb/oauth-js · GitHub
[go: up one dir, main page]

Skip to content
kingwjbPublic
forked from oauth-io/oauth-js

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

 
 

Latest commit

 

History

35 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

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

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

0