-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make RequestWithUser.samlLogoutRequest optional #678
Conversation
whenever I try to do `passport.use('strategyName', new SamlStrategy(...))` I get the following error: ``` Argument of type 'import("/Users/calvinhuang/scale/scaleapi3/server/node_modules/passport-saml/lib/passport-saml/strategy").Strategy' is not assignable to parameter of type 'import("/Users/calvinhuang/scale/scaleapi3/server/node_modules/@types/passport/index").Strategy' Types of property 'authenticate' are incompatible. Type '(req: RequestWithUser, options: AuthenticateOptions) => void' is not assignable to type '(this: StrategyCreated<Strategy, Strategy & StrategyCreatedStatic>, req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, options?: any) => any'. Types of parameters 'req' and 'req' are incompatible. Property 'samlLogoutRequest' is missing in type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>' but required in type 'RequestWithUser'. ``` It doesn't make sense to me that samlLogoutRequest needs to be present on every authentication request, and removing this would allow it to typecheck properly. I'm using @types/passport 1.0.7.
Commenting just this part of PR description:
It is used by propagating stuff from callback interfaces (authn and slo callback) to There was some sort of "half-way" fix for it (see node-saml/node-saml#10 and #619 ) which forces users of |
I would further like to note that |
Yeah, this is in regards to the Is there something I'm missing in order to have the following code typecheck properly? passport.use(new SamlStrategy(...)) |
this only seems to happen when there is a declaration for the namespace Express {
interface User {
...
}
} |
so in the rest of the app, we use |
@clhuang Any chance you can share more about how you resolved this? We are just starting to see this error after upgrading from 3.2.1 to 4.0.1, and we also have modified express's edit: Was able to get it to typecheck, not pretty but look at #549 (comment) |
Linking #549 to this issue. |
Description
whenever I try to do
passport.use('strategyName', new SamlStrategy(...))
I get the following error:It doesn't make sense to me that samlLogoutRequest needs to be present on every authentication request, and removing this would allow it to typecheck properly.
I'm using @types/passport 1.0.7.
Checklist: