Problem/Motivation

The oauth2_server module supports a lot of complicated flows but has a reported conflict with this module in that both want to use a header of the form "Authorization: Bearer $TOKEN"

A common flow that calls for using a JWT token is the machine-to-machine (MTM) flow with client credentials.

The best practice for MTM is to issue a JWT as the token, so this is something that could be easily handled by this module. The authorization after issuing the token is unchanged since it's simply JWT auth linked to a user account that represents a service account.

Proposed resolution

Add a sub-module the manages client credentials for user account (used as service accounts) and provides an endpoint for issuing a short lived (e.g. 1 hour) JWT in response to client credentials.

Remaining tasks

Implement, add tests

User interface changes

New tab on user profiles (and controlling permission) to add/manage client secrets. Like the users_jwt module, This will include the option to generate the client secret.

API changes

n/a

Data model changes

n/a

Will use user data storage service like users_jwt module

Issue fork jwt-3606578

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pwolanin created an issue. See original summary.

pwolanin’s picture

Title: Add a sumb-module to support simple Oauth2 MTM flow » Add a sub-module to support simple Oauth2 MTM flow
pwolanin’s picture

Version: 2.x-dev » 2.3.1

dandrews made their first commit to this issue’s fork.

pwolanin’s picture

Status: Active » Needs review
pwolanin’s picture

Status: Needs review » Reviewed & tested by the community

Added test pass, looks good overall.

We'll have to port it forward to the 3.x branch also and later add support for multiple keys

it has a functional test, though I don't think it actually makes a request with the generated JWT? That would be something to add next, but requires a little extra setup. It would be nice it see the full flow in a functional test.

  • pwolanin committed aaa4a176 on 2.x authored by dandrews
    feat: #3606578 Add a sub-module to support simple Oauth2 MTM flow
    
    By:...
pwolanin’s picture

Version: 2.3.1 » 3.x-dev

needs to be forward ported