https://github.com/wejs/we-plugin-passport-google
We.js google passport authentication
https://github.com/wejs/we-plugin-passport-google
google-passport wejs
Last synced: 3 months ago
JSON representation
We.js google passport authentication
- Host: GitHub
- URL: https://github.com/wejs/we-plugin-passport-google
- Owner: wejs
- Created: 2015-10-05T00:55:36.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-02-06T16:02:35.000Z (over 5 years ago)
- Last Synced: 2025-02-23T22:06:53.611Z (4 months ago)
- Topics: google-passport, wejs
- Language: JavaScript
- Size: 19.5 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# We.js plugin for add passoport authentication
> Plug passport-google-oauth npm module in we.js project with auth urls
## How to install
```sh
we i we-plugin-passport-google
```## How to configure
Passport strategies for authenticating with Google using OAuth 1.0a and OAuth 2.0.
This plugin lets you authenticate using Google in your We.js applications.
The client id and client secret needed to authenticate with Google can be set up from the developer's console Google Developer's Console: https://console.developers.google.com/project .
To configure in your project update the file: `config/locals.js` :
```
// ...
passport: {
strategies: {
google: {
clientID: 'your google api client id',
clientSecret: 'your google api client secret',
redirectUrlAfterSuccess: '/',
redirectUrlAfterFailure: '/login',
// scope: [
// 'profile',
// 'email',
// 'https://www.googleapis.com/auth/plus.me',
// 'https://www.googleapis.com/auth/userinfo.email'
// ],
// callbackURL: 'a custom callback url' // optional
}
}
},
// ...
```## API
#### Login with google url:
This url will start the authentication.
'get /auth/google': {
controller : 'passportGoogle',
action : 'page',
responseType : 'json'
},#### Callback from google url:
'get /auth/google/callback': {
controller : 'passportGoogle',
action : 'callback',
responseType : 'json'
}## Links
> * We.js site: http://wejs.org
> * Google passport npm module: https://github.com/jaredhanson/passport-google-oauth## License
MIT