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

3rd party re-login was not working using custom user models #256

Closed
wants to merge 1 commit into from

Conversation

mkilp
Copy link

@mkilp mkilp commented May 24, 2018

Description

While using a custom user model I ran into the problem, that on a 3rd party login with Azure AD the user identity model was not able to find the related user model.
Therefore a login was never successful.
Fixed by manually looking up the user in the related user model (custom or not) and using this user object.

Related issues

Checklist

  • New tests added or existing tests modified to cover all changes
  • Code conforms with the styleguide

Ran the NPM tests which were already included, as I didn't implement new things.

@slnode
Copy link

slnode commented May 24, 2018

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

@dhmlau
Copy link
Member

dhmlau commented May 30, 2018

@slnode test please

@mkilp
Copy link
Author

mkilp commented May 31, 2018

Tests seem successful, any updates on this? :)

@dhmlau
Copy link
Member

dhmlau commented Aug 18, 2018

@Nop0x , could you please sign the CLA https://cla.strongloop.com/agreements/strongloop/loopback-component-passport?
@strongloop/sq-lb-apex @bajtos , could you please review? Thanks.

@mkilp
Copy link
Author

mkilp commented Aug 20, 2018

@dhmlau Signed the agreement!

@dhmlau
Copy link
Member

dhmlau commented Aug 20, 2018

@slnode test please

@rmg
Copy link
Member

rmg commented Aug 20, 2018

@Nop0x did you sign it as @emdatabots?

// When using custom user models, the relation between Identity and User does not seem to work.
// Fetching the user model out of the identity.
if (err) {
cb(err, identity);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this return here? If the fall-through behaviour is expected then there should probably be a comment indicating why.

@mkilp
Copy link
Author

mkilp commented Aug 20, 2018

@rmg i did not mean to sign with @emdatabots, thats another github account of me for work.
I'll be looking into your review.

@rmg
Copy link
Member

rmg commented Aug 20, 2018

@Nop0x you signed as your normal user, but your commit is authored by your work account. You'll need to rebase and force push (probably something like git config user.email personal@domain && git commit --amend --no-edit --reset-author && git push origin +master, assuming origin is the name of your fork remote)

@stale
Copy link

stale bot commented Sep 17, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 17, 2019
@stale
Copy link

stale bot commented Oct 1, 2019

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants