Skip to content

Add client credentials flow#337

Merged
xerbalind merged 7 commits into
mainfrom
client_credentials
Oct 29, 2025
Merged

Add client credentials flow#337
xerbalind merged 7 commits into
mainfrom
client_credentials

Conversation

@xerbalind
Copy link
Copy Markdown
Member

https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/

The Client Credentials grant is used when applications request an access token to access their own resources, not on behalf of a user.

A client can get an access token when providing the client id and secret during the oauth flow. I assume that the client secret is only known by the client/application itself.

The client information endpoint is /current_client and only works with a client session.

Currently the only endpoint supporting a client session is the /mails/new and is also only authorized by clients with the mailer role. (added role support for clients)

Tests will follow.

@xerbalind
Copy link
Copy Markdown
Member Author

I also refactored the different FromRequest implementations for each session type, so it forwards to the next FromRequest when encountering a wrong Session instead of erroring.

@xerbalind
Copy link
Copy Markdown
Member Author

The distinction between clients having roles (like with users) and roles only applying to specific clients might now be confusing, so I'm open for suggestions :).

@xerbalind xerbalind requested review from msathieu and rien October 6, 2025 22:09
@xerbalind xerbalind merged commit 25a4b19 into main Oct 29, 2025
3 checks passed
@xerbalind xerbalind deleted the client_credentials branch October 29, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants