Questions tagged [koa-passport]
20 questions
6
votes
2 answers
koa-passport logout() is not clearing session
I am using koa, koa-passport and koa-session to log users in which works fine but when I call ctx.logout() the user can refresh and still be logged in. It seems that ctx.session and/or the cookies are not being correctly cleared.
This still fails…

Jareth
- 431
- 1
- 3
- 16
3
votes
1 answer
Discord OAuth2 login with koa
I'm trying to use the koa and passport to login to discord.
I used the examples of koa-passport and passport-discord, but somehow I can't get it to work. It seems that most of it works (I get the accessToken, refreshToken and the profile info), but…

Andreas Gassmann
- 6,334
- 7
- 32
- 45
3
votes
0 answers
why my koa-passport authenticate parameter user is always undefined?
I'm trying to use koa-passport for koa2, and followed the examples of the author, but i always get "Unauthorized". I used the console.log and found that it even not hit the serializeUser.
var UserLogin = async (ctx, next) =>{
return…

Vega
- 33
- 1
- 6
1
vote
1 answer
@types/passport version 1.0.5 generates new error: Type Authenticator does not satisfy the constraint IncomingMessage
I have a Koa.JS web app that uses Passport.JS for oAuth2 authentication. This web app is written in typescript. Here is the authentication code:
import { deserializeUser, serializeUser, use } from 'koa-passport';
import { Strategy, VerifyCallback }…

B. Mazeran
- 33
- 1
- 5
1
vote
1 answer
koa-passport Authentication Always Returns 4XX
When using koa-passport I am always receiving a 404 or 401 error.
passport.authenticate( 'local', {
successRedirect: '/',
failureRedirect: '/login',
failureFlash: true
} );

bicarlsen
- 1,241
- 10
- 27
1
vote
0 answers
PassportJS Error: No other operations may be performed on the connection while a bind is outstanding intermittently
TLDR: Is there a race condition issue with passportjs or passport-ldapauth?
I am using the koa-passport library with the passport-ldapauth strategy in a nodejs application intended to authenticate a user against AD (Active Directory). Wow, that…

Rafay Zafer
- 11
- 1
1
vote
1 answer
How to integrate Koa, Passport and MongoDB?
*Please don't ignore the question looking at its length. It might seem long because I've attached the code. The actual problem statement is really small.
I've tried integrating Passport, Koa & MongoDB from the last two days. I've been failing and am…

psvs
- 199
- 1
- 4
- 14
1
vote
0 answers
KOA - Passport with Password Grant strategy
Hi I am trying to implement password grant strategy with Koa-passport. I configured a strategy as below
passport.use(new PasswordGrantStrategy({
tokenURL: "http://localhost:3001/api/v1/oauth/token",
clientID: "democlient1",
…

Meiyappan Kannappa
- 720
- 9
- 35
1
vote
0 answers
Why the error will cause the koa application to stop
This is the code i used
auth.js
const passport = require('koa-passport')
const options = {
server: {
...
}
};
passport.serializeUser(function(user, done) {
done(null, user)
})
passport.deserializeUser(function(user, done) {
…

abnerCrack
- 91
- 1
- 4
1
vote
2 answers
Koa 2 + Passport + async
Trying to implement a local Passport strategy in Koa 2 but I'm missing something vital...
When my route hits passport.authenticate(), I'm able to retrieve my user but I'm never returning from that await(), so my code doesn't progress any…

Nico Galluzzo
- 485
- 1
- 3
- 8
1
vote
0 answers
Koa-passport - "Internal error: illegal access" when accessing the req parameter
Hi all I am messing with Koa and Koa passport and experiencing an issue when working with Koa passport and variants on the LocalStrategy. First I tried to option into the LocalStrategy the passing of the req to the authentication method (your…

akaphenom
- 6,728
- 10
- 59
- 109
0
votes
0 answers
Updating `userProperty` in koa-passport doesn't work
I can't for the life of me figure this one out :(
Problem
My app is a game, so the users are called players. In order to keep consistency across the app, I want to change the property name that koa-passport uses when it logs a user in. The default…

woollyblanket
- 1
- 2
0
votes
1 answer
Koa & Passport Missing credentials
I have a Koa server that uses Passport to authenticate users against an Array,
and a React client. After successful login, the following requests are not authenticated as the cookie is undefined. The authenticate function's error parameter has:
{…

Nice Books
- 1,675
- 2
- 17
- 21
0
votes
2 answers
koa-router doesn't work with passport-local strategy
passport.authenticate from koa-passport doesn't work with local strategy. I use no sessions, no serializing. It's just simple passport example, but the server response is always 404.
const Koa = require('koa');
const bodyParser =…

Sergey Pogranichniy
- 356
- 4
- 9
0
votes
1 answer
How to encapsulate Koa-Passport?
Perhaps this has a very easy answer, yet something is off with my code. Here is what I want to do.
I created a koa2 app using koa-passport, and I want to encapsulate the usage of Passport in a class AuthAdapter (shortened below).
class AuthAdapter…

Kat Lim Ruiz
- 2,425
- 2
- 26
- 32