passport.js

Laravel Passport Token for Generation

巧了我就是萌 提交于 2019-12-25 01:34:39
问题 Trying Passport Token System First Time. By URL: http://localhost:8000/oauth/token, Access token and Refresh token can be available. But, unable to use oauth/token Post method in laravel Controller file Some links: Laravel 5.6 pass oauth/token hanging Guzzle Cannot make GET request to the localhost (port: 80, 8000, 8080, etc ) namespace App\Http\Controllers\api; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Carbon\Carbon; use App

Using passport and OAuth with connect-redis

冷暖自知 提交于 2019-12-24 21:18:30
问题 I am trying to use passport-twitter and passport-facebook for authentication in an app that is using Redis for Express sessions. If I remove the connect-redis for storing sessions in express, everything works fine, but with the Redis sessions, I get the following error: Error: OAuth authentication requires session support | at Strategy.OAuthStrategy.authenticate My code is below: app.configure(function(){ app.set('port', process.env.PORT || port); app.use(express.favicon()); app.use(express

req.user not available in Google Passport Strategy

送分小仙女□ 提交于 2019-12-24 19:43:16
问题 I have an express app which manages authentication via Passport, initially with a local strategy. To this I have just added Google sign in / account creation and almost everything works as per the docs. The problem I have is that a user can create an account using the Google Strategy but I cannot quite get it so that an authenticated user (via the local strategy) can simply add additional Google details to their account so that they can use either the local or Google strategy. In 'index.js'

Update or add fields in passport.js local-strategy?

旧城冷巷雨未停 提交于 2019-12-24 17:24:32
问题 Im all over the docs, but I cant seem to find a way to update credentials. This is what I was able to pick up by analyzing the code. passport.deserializeUser(function(id, done) { AppUser.findById(id, function(err, user) { done(err, user); }); }); DeserializeUser seems useful, but I am not sure how to use it to update a or add fields? I was trying to hack away and copy the logic from the login and make sense of it. passport.use('local-update', new LocalStrategy({ usernameField : 'username',

Passport Facebook Strategy, trigger route with AJAX

人盡茶涼 提交于 2019-12-24 17:14:30
问题 The problem: XMLHttpRequest cannot load https://www.facebook.com/dialog/oauth?response_type=code&redirect_uri=http%…lhost%3A8080%2Fapi%2Fauth%2Ffacebook%2Fcallback&client_id=1527429390857121. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. If i click the link in the error i get autenticated and get back the datas in json. If i remove the clientside js router everithing works fine. But i am trying to

ReferenceError: User is not defined

你离开我真会死。 提交于 2019-12-24 13:50:29
问题 I've got an error while i try to auth via vkontakte (vk.com) (passport-vkontakte) Error: ReferenceError: User is not defined Here is my auth.js var express = require('express'); var passport = require('passport'), VKontakteStrategy = require('passport-vkontakte').Strategy; var router = express.Router(); var app = express(); router.get('/', function(req, res) { res.send('Auth'); }); passport.use(new VKontakteStrategy({ clientID: 000, // VK.com docs call it 'API ID' clientSecret: '***',

logout using express and passport

為{幸葍}努か 提交于 2019-12-24 11:30:00
问题 I'm using express.js and passport-jwt and I'm creating a middleware that checks user in every API call and then assigns to req a user. So then every time I log req.user , I get details about my user and that works fine. Then if I want to log this user out I used req.logout() , req.logOut() , req.destroy() and even I tried to assign null to req.user and it still logged in please I need help. passport config const JwtStrategy = require('passport-jwt').Strategy; const ExtractJwt = require(

Passport.js - Local strategy doesn't authenticate

痞子三分冷 提交于 2019-12-24 09:08:43
问题 I've build a simple app that allows users to log in through google using passport's google strategy and it all works fine. I'm trying to add a local strategy as well, but I can't find a solution. Database works fine as users get created during sign up process. But redirecting to /profile doesn't work right after signing up. Instead, I get redirected to the login page; this normally happens when the user is trying to visit the /profile page but is not logged in. Logging in seems to work

Nothing returned when deserializing user in node and passport

可紊 提交于 2019-12-24 07:35:11
问题 I am trying to login my user in the node application, using OrientDB as the database and node js and express. I have imported passport actually adopted the solution from one of my mongo db projects. The Problem is that when I try to login I get [object, object] but no errors. This is what my code looks like: user model file: var db = require('../utils/oriento.js'); const OrientDB = require('orientjs'); var User = function (data) { this.data = { name: data.name, email: data.email, password:

Cannot get `cookieSession` working with `maxAge`

蓝咒 提交于 2019-12-24 07:25:16
问题 ** SOLVED ** I've been struggling with this one for a bit. Lots of similar posts out there, but none of the proposed solutions are working for me. I'm using Express and Passport with cookie sessions. When I pass just the secret to cookieSession everything works fine: app.use(express.cookieParser('MySecret')); app.use(express.cookieSession('MySecret')); app.use(passport.initialize()); app.use(passport.session()); But the default cookie is session-based, and so it clears when you close your