Skip to content
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

Pass more to local authentication params #165

Closed
saiichihashimoto opened this Issue Apr 18, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@saiichihashimoto
Copy link
Contributor

saiichihashimoto commented Apr 18, 2016

I'm trying to create an app where there's different areas of the room, somewhat like slack teams. A person may have the same email in different areas. So when someone logs in, I want to retrieve them by username but ALSO by the area. In other words, I need to add to the params used to retrieve from the user service. As it stands, there's no way to do that.

@ekryski

This comment has been minimized.

Copy link
Member

ekryski commented Apr 20, 2016

I think the only way would be to add a before hook on your user service that adds the params when going through authentication. I don't think we can pass more params inside the checkCredentials function because it's signature is dictated by passport. I don't think that we can mess with it. We might need wrap it so that we have the right params context coming from the create method... I'd have to tinker with it and don't really have time at the moment.

Did you have any success @saiichihashimoto?

@saiichihashimoto

This comment has been minimized.

Copy link
Contributor Author

saiichihashimoto commented Apr 25, 2016

A before hook doesn't solve my problem. When check credentials looks up the user via the app service, it only passes the username as a query parameter. I want to use information from the request (in my case, the current subdomain), and have that be one of the query parameters. Regardless of any before hooks we'll always get the same query, currently.

Just like #171, I need to do some logic on the parameters before I pass them in. I'm fine hacking together a solution for my specific case, but I'm having a hard time doing what I want without having to rewrite the whole file for my case.

@saiichihashimoto

This comment has been minimized.

Copy link
Contributor Author

saiichihashimoto commented Apr 28, 2016

Does what I'm saying make sense?

@ekryski ekryski closed this in #186 Apr 29, 2016

ekryski added a commit that referenced this issue Apr 29, 2016

Allow manipulation of params before checking credentials (#186)
* Allow manipulation of params before checking credentials

Closes #165 Closes #171

* buildCredentials for local auth service

* Move passReqToCallback into defaults

daffl added a commit to feathersjs/feathers that referenced this issue Aug 29, 2018

Allow manipulation of params before checking credentials (#186)
* Allow manipulation of params before checking credentials

Closes feathersjs/authentication#165 Closes feathersjs/authentication#171

* buildCredentials for local auth service

* Move passReqToCallback into defaults

daffl added a commit to feathersjs/feathers that referenced this issue Aug 29, 2018

Allow manipulation of params before checking credentials (#186)
* Allow manipulation of params before checking credentials

Closes feathersjs/authentication#165 Closes feathersjs/authentication#171

* buildCredentials for local auth service

* Move passReqToCallback into defaults
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.