public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
To: Lukas Wagner <l.wagner@proxmox.com>
Cc: pve-devel@lists.proxmox.com
Subject: Re: [PATCH pve-docs 1/1] notifications: Add section about OAuth2 to SMTP targets docs
Date: Wed, 11 Feb 2026 14:15:17 +0100	[thread overview]
Message-ID: <vqssojoseuyrw6ju5z2qtukdjhjnoobkowy7w75yw6fawamnb2@f7kfzxnkgilg> (raw)
In-Reply-To: <DGC1RJU8PZCX.24H6P5RFWOJ1K@proxmox.com>

On Wed, Feb 11, 2026 at 11:06:24AM +0100, Lukas Wagner wrote:
> Hi!
> 
> Nice work overall, some hints for some refinements for the next version
> inline.
> 
> On Wed Feb 4, 2026 at 5:13 PM CET, Arthur Bied-Charreton wrote:
> > Document the new config entries, and add notes/warnings to communicate
> > that:
> >
> > 1. User intervention is required for initial OAuth2 target setup, and
> >
> > 2. Microsoft OAuth2 apps *must not* be configured as SPAs by the
> > user, since it would prevent PVE from automatically extending the
> > refresh token's lifetime
> >
> > Signed-off-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
> > ---
> >  notifications.adoc | 44 ++++++++++++++++++++++++++++++++++++++++----
> >  1 file changed, 40 insertions(+), 4 deletions(-)
> >
> > diff --git a/notifications.adoc b/notifications.adoc
> > index 801b327..679b19b 100644
> > --- a/notifications.adoc
> > +++ b/notifications.adoc
> > @@ -108,16 +108,23 @@ The configuration for SMTP target plugins has the following options:
> >  * `from-address`: Sets the From-address of the email. SMTP relays might require
> >    that this address is owned by the user in order to avoid spoofing.  The `From`
> >    header in the email will be set to `$author <$from-address>`.
> > +* `auth-method`: Sets the authentication method (`plain`, `google-oauth2` or
> > +  `microsoft-oauth2`).
> >  * `username`: Username to use during authentication. If no username is set,
> >    no authentication will be performed. The PLAIN and LOGIN authentication
> >    methods are supported.
> >  * `password`: Password to use when authenticating.
> > +* `oauth2-client-id`: Client ID for the OAuth2 application, if applicable.
> > +* `oauth2-client-secret`: Client secret for the OAuth2 application, if
> > +  applicable.
> > +* `oauth2-tenant-id`: Tenant ID for the OAuth2 application, if applicable.
> > +  Only required for Microsoft OAuth2.
> >  * `mode`: Sets the encryption mode (`insecure`, `starttls` or `tls`). Defaults
> >    to `tls`.
> >  * `server`: Address/IP of the SMTP relay.
> 
> 
> 
> > -* `port`: The port to connect to. If not set, the used port .
> > -   Defaults to 25 (`insecure`), 465 (`tls`) or 587 (`starttls`), depending on
> > -   the value of `mode`.
> > +* `port`: The port to connect to. If not set, the used port defaults to 25
> > +  (`insecure`), 465 (`tls`) or 587 (`starttls`), depending on the value of
> > +  `mode`.
> >  * `comment`: Comment for this target
> 
> Thanks for fixing this up, but since this is completely unrelated to
> your OAuth changes, this should rather be a separate commit (as the
> first-patch of the pve-docs part of the series - since then it can be
> applied independently while this series as a whole is still in progress)
> 
> >  
> >  Example configuration (`/etc/pve/notifications.cfg`):
> > @@ -133,13 +140,42 @@ smtp: example
> >  ----
> >  
> >  The matching entry in `/etc/pve/priv/notifications.cfg`, containing the
> > -secret token:
> > +password:
> >  
> >  ----
> >  smtp: example
> >          password somepassword
> >  ----
> 
> this here as well
> 
Thanks, sent a separate patch:
https://lore.proxmox.com/pve-devel/20260211131323.232299-1-a.bied-charreton@proxmox.com/T/#u
> >  
> > +[[notification_targets_smtp_oauth2]]
> > +===== OAuth2 Authentication
> > +
> > +SMTP targets also support OAuth2 authentication via the XOAUTH2 mechanism for
> > +Google and Microsoft mail providers.
> > +
> > +Setting up OAuth2 authentication requires creating an OAuth2 application with
> > +the chosen provider. The application must be configured with a redirect URI
> > +pointing to the {pve} web interface, i.e. the URL from which the initial
> > +authentication request is performed in the UI.
> 
> I guess you could also mention that one could add all cluster nodes as
> permitted origins and redirect URIs. It would also be good to maybe add
> some concrete examples for sensible origins and redirect URIs,
> mentioning common restrictions (e.g. Google not allowing IPs)
> 
> > +
> > +CAUTION: For Microsoft, the application must *not* be registered as Single-Page
> > +Application (SPA), as the lifetime of refresh tokens granted for SPAs cannot
> > +be extended automatically by {pve}.
> > +
> > +To set up OAuth2 authentication via the web interface, select `OAuth2 (Google)`
> > +or `OAuth2 (Microsoft)` as the authentication method, fill in the client ID and
> > +secret (and the tenant ID for Microsoft), then click the *Authenticate* button.
> > +This opens a new window where you can sign in with the selected provider and
> > +grant the required permissions. Upon successful authentication, a refresh
> > +token is obtained and stored automatically.
> > +
> > +Token refresh happens automatically, manual intervention is only needed if a
> > +token is revoked.
> 
> Maybe elaborate what 'manual intervention' means in this case (I assume
> re-authorize?) . Also could not hurt to mention the pvesh command to
> trigger a manual token refresh.
> 
> > +
> > +NOTE: OAuth2 is currently not configurable through direct configuration file
> > +editing because the refresh token is managed as dynamic state by {pve}. All
> > +OAuth2 targets must be configured via the web interface.
> 
> Maybe mention that one could also add the endpoint by using the
> appropriate API endoint, supplying a token that they requested by other
> means.
> 
> > +
> >  [[notification_targets_gotify]]
> >  Gotify
> >  ~~~~~~
> 
Thanks, will update the docs accordingly!




  reply	other threads:[~2026-02-11 13:15 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04 16:13 [RFC cluster/docs/manager/proxmox{,-perl-rs,-widget-toolkit} 00/15] fix #7238: Add XOAUTH2 authentication support for SMTP notification targets Arthur Bied-Charreton
2026-02-04 16:13 ` [PATCH proxmox 1/5] notify: Introduce xoauth2 module Arthur Bied-Charreton
2026-02-06 15:00   ` Lukas Wagner
2026-02-09  8:34     ` Arthur Bied-Charreton
2026-02-10  8:24       ` Lukas Wagner
2026-02-10 10:23         ` Arthur Bied-Charreton
2026-02-04 16:13 ` [PATCH proxmox 2/5] notify: Add state file handling Arthur Bied-Charreton
2026-02-10 15:51   ` Lukas Wagner
2026-02-04 16:13 ` [PATCH proxmox 3/5] notify: Update Endpoint trait and Bus to use State Arthur Bied-Charreton
2026-02-10 15:52   ` Lukas Wagner
2026-02-12  8:26     ` Arthur Bied-Charreton
2026-02-04 16:13 ` [PATCH proxmox 4/5] notify: smtp: add OAuth2/XOAUTH2 authentication support Arthur Bied-Charreton
2026-02-10 15:52   ` Lukas Wagner
2026-02-11 13:00     ` Arthur Bied-Charreton
2026-02-04 16:13 ` [PATCH proxmox 5/5] notify: Add test for State Arthur Bied-Charreton
2026-02-04 16:13 ` [PATCH proxmox-perl-rs 1/1] notify: update bindings with new OAuth2 parameters Arthur Bied-Charreton
2026-02-04 16:13 ` [PATCH proxmox-widget-toolkit 1/2] utils: Add OAuth2 flow handlers Arthur Bied-Charreton
2026-02-04 16:13 ` [PATCH proxmox-widget-toolkit 2/2] notifications: Add opt-in OAuth2 support for SMTP targets Arthur Bied-Charreton
2026-02-04 16:13 ` [PATCH pve-manager 1/5] notifications: Add OAuth2 parameters to schema and add/update endpoints Arthur Bied-Charreton
2026-02-11  8:55   ` Lukas Wagner
2026-02-11 12:47     ` Arthur Bied-Charreton
2026-02-04 16:13 ` [PATCH pve-manager 2/5] notifications: Add refresh-targets endpoint Arthur Bied-Charreton
2026-02-11  9:49   ` Lukas Wagner
2026-02-11 12:44     ` Arthur Bied-Charreton
2026-02-04 16:13 ` [PATCH pve-manager 3/5] notifications: Trigger notification target refresh in pveupdate Arthur Bied-Charreton
2026-02-04 16:13 ` [PATCH pve-manager 4/5] notifications: Handle OAuth2 callback in login handler Arthur Bied-Charreton
2026-02-11  9:00   ` Lukas Wagner
2026-02-04 16:13 ` [PATCH pve-manager 5/5] notifications: Opt into OAuth2 authentication Arthur Bied-Charreton
2026-02-04 16:13 ` [PATCH pve-cluster 1/1] notifications: Add refresh_targets subroutine to PVE::Notify Arthur Bied-Charreton
2026-02-04 16:13 ` [PATCH pve-docs 1/1] notifications: Add section about OAuth2 to SMTP targets docs Arthur Bied-Charreton
2026-02-11 10:06   ` Lukas Wagner
2026-02-11 13:15     ` Arthur Bied-Charreton [this message]
2026-02-13 16:06 ` superseded: [RFC cluster/docs/manager/proxmox{,-perl-rs,-widget-toolkit} 00/15] fix #7238: Add XOAUTH2 authentication support for SMTP notification targets Arthur Bied-Charreton
2026-02-13 16:03 [PATCH cluster/docs/manager/proxmox{,-perl-rs,-widget-toolkit} 00/17] " Arthur Bied-Charreton
2026-02-13 16:04 ` [PATCH pve-docs 1/1] notifications: Add section about OAuth2 to SMTP targets docs Arthur Bied-Charreton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vqssojoseuyrw6ju5z2qtukdjhjnoobkowy7w75yw6fawamnb2@f7kfzxnkgilg \
    --to=a.bied-charreton@proxmox.com \
    --cc=l.wagner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal