Closed jackrvaughan closed 6 years ago
Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."
@slnode test please
@jackrvaughan cool the existing tests pass, could you add a few new test case for the additional fields? Thanks.
@jannyHou I added a test case to ensure the custom field mapping works. Hope this is acceptable!
@jannyHou I noticed one check didn't pass (Commit Linter) because one of my commits was over 50 characters. Is that a problem?
@jackrvaughan Thank you for the patch. Good idea.
The commit log has an issue:
** Linting commit logs
**
** 1 problems found:
** dd282d3 - changed description from 'profile' to 'field' mappi: First line should be 50 characters or less (saw 53)
**
BTW, I think we already allow the mapping - https://github.com/strongloop/loopback-component-passport/blob/master/test/passport-configurator.test.js#L108.
Can you clarify?
@raymondfeng I believe that's only for LDAP?
I've gone back and fixed the commit. But now it's saying my PR is out of date - I'll work on rebasing it soon.
Description
Allows you to map certain fields from a third party provider (
firstname
for example) to a custom field in the user profile model. The current code only creates a new user withusername
,email
, andpassword
which is extremely limiting.This update will allow you to add a
profileMapping
field to the provider object in providers.json that will map third party fields to custom user fields. Here is an example of whatprofileMapping
could look like:If
profileMapping
the profileToUser function will parse the third party profile json to get and set the appropriate field for the user model (or whatever local modal is being used).Related issues
Checklist