jozzhart / passport-youtube Goto Github PK
View Code? Open in Web Editor NEWYoutube strategy for passport
License: MIT License
Youtube strategy for passport
License: MIT License
The method Strategy.prototype.authorizationParams
in 0.0.6 has a less flexible code than the master branch.
// 0.0.6
Strategy.prototype.authorizationParams = function(options) {
// test, should be passed through options
return {
access_type : 'offline'
}
}
// master
Strategy.prototype.authorizationParams = function(options) {
var params = {};
if (options.accessType) {
params['access_type'] = options.accessType;
}
if (options.approvalPrompt) {
params['approval_prompt'] = options.approvalPrompt;
}
return params;
}
Can you please make a 0.0.7 including those changes?
Thanks.
ps. without the approval_prompt
flag, the refreshToken
is not given back by the strategy, which can be problematic
If I request scope https://www.googleapis.com/auth/youtube it works fine, but if I change scope to https://www.googleapis.com/auth/youtube.readonly (the readonly one) it doesn't work?
Error:
failed to fetch user profile (status: 401 data:
...
Token invalid
...
at ../passport/passport-youtube test/node_modules/passport-youtube/lib/passport-youtube/strategy.js:55:28
at passBackControl (./passport/passport-youtube test/node_modules/passport-youtube/node_modules/passport-oauth/node_modules/oauth/lib/oauth2.js:105:9)
at IncomingMessage. (../passport/passport-youtube test/node_modules/passport-youtube/node_modules/passport-oauth/node_modules/oauth/lib/oauth2.js:124:7)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:910:16
at process._tickCallback (node.js:415:13)
Unless this library upgrades to passport-oauth ^1.0.0 it will crash req.logIn(...)
when the app is using the latest version of Passport. This is caused by introducing lazy session initialization in passport 0.3.0. See the technical details and Jared's explanation.
Let me know if I can help.
This strategy doesn't seem to be returning the refresh token. After taking a peek at the code, it looks like this is trying to use access_type: 'offline'
, but it doesn't seem to be working.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.