Problem/Motivation

In many cases an end-user is more likely to know their user name rather than UID. Also, REST and jsonapi consider the UUID to be the main identifier. Since the name and UUID are also unique in Drupal, is should be possible to authenticate with a claim on the user name or UUID.

Proposed resolution

Add support for an alternate claim on name instead of uid

Remaining tasks

add patch, add tests.

User interface changes

N/A

API changes

added auth technique

Comments

pwolanin created an issue. See original summary.

pwolanin’s picture

Title: Allow a claim for user name instead of uid to authenticate » Allow a claim for user name or uuid instead of uid to authenticate
Issue summary: View changes
pwolanin’s picture

Status: Active » Needs review
StatusFileSize
new8.99 KB
pwolanin’s picture

pwolanin’s picture

StatusFileSize
new9.71 KB

updated README

pwolanin’s picture

StatusFileSize
new16.67 KB

Also change the users_jwt module to match.

That module still needs a test update.

Status: Needs review » Needs work

The last submitted patch, 6: 3150293-6.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

pwolanin’s picture

Status: Needs work » Needs review
StatusFileSize
new13.33 KB

oops, that's right. the jwt module is not a dependency. A little annoying there is not another way to share a little bit of library code.

pwolanin’s picture

StatusFileSize
new25.84 KB

Add test cases for the newly supported claims, plus resolve deprecations.

pwolanin’s picture

StatusFileSize
new26.11 KB

clean up code style

pwolanin’s picture

StatusFileSize
new26.34 KB

more code style cleanup

edwardchiapet’s picture

Thanks, @pwolanin! The patch looks good and can be included in the next release.

pwolanin’s picture

Status: Needs review » Reviewed & tested by the community
pwolanin’s picture

Status: Reviewed & tested by the community » Fixed

  • pwolanin committed 9831e4f on 8.x-1.x
    Issue #3150293 by pwolanin: Allow a claim for user name or uuid instead...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.