Comments (2)
Just tested this, and it works for me, maybe it's due to your encoding of the url and google doesn't like that:
app.get('/oauth', function (req, res) {
var oauth = new moth.OAuth({
requestUrl: "https://www.google.com/accounts/OAuthGetRequestToken?scope=https%3A%2F%2Fwww.google.com%2Fcalendar%2Ffeeds%2F+https%3A%2F%2Fwww.google.com%2Fm8%2Ffeeds%2F+https%3A%2F%2Fpicasaweb.google.com%2Fdata%2F",
accessUrl: "https://www.google.com/accounts/OAuthGetAccessToken",
callback: "http://localhost/oauth/callback",
consumerKey: "anonymous",
consumerSecret: "anonymous",
version: "1.0",
signatureMethod: "HMAC-SHA1"
});
oauth.getOAuthRequestToken(function (error, token, secret, results) {
if (error) {
res.error(500, error);
} else {
host = "https://www.google.com/";
url = "accounts/OAuthAuthorizeToken";
params = "?oauth_token=" + token + "&hl=fr";
res.redirect(host + url + params);
}
});
});
app.get('/oauth/callback', function (req, res) {
console.log(req.params, req.body);
});
Forgot to add the port so it didn't go to express but it does work:
from mashape-oauth.
It's working!
Thank you very much, I have no idea why I encoded the callback URL.
from mashape-oauth.
Related Issues (14)
- Dropbox - Unknown field `type`
- promise support? HOT 1
- what is the main differences between `mashape-oauth` and `node-oauth` HOT 2
- add JWT OAuth2 flow?
- Broken Link to spring.io CSRF article HOT 1
- When using a query string as the body, type is no longer "optional"
- authHeader() throws "TypeError: context.hasOwnProperty is not a function" when body is a query string HOT 1
- npm version is out of date HOT 1
- Preformatted text in FLOWS.md markdown HOT 2
- Markdown Verbatim Formatting Broken in 2 Places
- OauthAccessToken > 400 signature invalid from Google
- difference mashape-oauth and passport + passport-oauth HOT 3
- Oauth not working request with headers.Accept='application/pdf' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mashape-oauth.