jakartaee / jakartaee/mail-api

Support Refresh token and Client Credentials/Service Account/Custom token Support for OAuth2

Open
#585 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
285
Forks
109
Avg merge
15h 19m
Merged PRs (30d)
1

Description

**Is your feature request related to a problem? Please describe.**
Currently OAuth2 support includes just passing the access token while making a connection. But there are few problems as the developers had to write the complete token management around it. And it will be even more useful if developer is using connection pool approach.

https://nodemailer.com/smtp/oauth2/ Node mailer provides a good support for managing the tokens around OAuth2 in built into the API.

What i would like to see

1) Accept client Id and Client secret and use standard OAuth2 client credentials workflow and get access token. Also, when access token getting expired renew the access token (expired or revoked scenarios) if developer is using connection pooling approach. For popular services like Gmail, Exchange online bake in the access token endpoints and for others can accept the input of access token endpoint.
2) Accept refresh token (optionally with an access token along with client id and client secret) so that one can use the standard token workflow to renew the access token as and when its expired or revoked. For popular services like Gmail, Exchange online bake in the access token endpoints and for others can accept the input of access token endpoint.
3) For non standard services/endpoints provide a callback support (accepting an anonymous/lambda/interface) so that it gets called during token retrieval/renewal scenarios.

Contributor guide

Open the contributing guide

Research direction

No file or test is named in the issue; begin by locating the existing OAuth2 access-token API and its connection-pooling behavior. Done means supporting client-credentials, refresh-token, and custom callback workflows, including token renewal and configurable endpoints for nonstandard services.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, authentication
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.