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
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
Comment #2
pwolanin commentedComment #3
pwolanin commentedComment #6
pwolanin commentedComment #7
pwolanin commentedAdded 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.
Comment #9
pwolanin commentedneeds to be forward ported