Skip to content

Commit 1398c1d

Browse files
authored
Update OAuth2 authentication instructions in README
Clarified OAuth2 authentication instructions and options for storing access tokens.
1 parent 4327d9c commit 1398c1d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ Mailkit supports `OAuth2` authentication by specifying `SmtpAuthentication = OAu
4949
- `SmtpUserName = ${gdc:OAuthClientId}`
5050
- `SmtpPassword = ${gdc:OAuthClientSecret}`
5151

52-
Before using OAuth2 authentication, make sure to acquire an access token from your email provider (e.g., Gmail, Outlook) and store it in the [Global Diagnostics Context (GDC)](https://github.com/NLog/NLog/wiki/Gdc-layout-renderer) with the key `OAuthClientSecret` (And ensure it is refreshed before expiry).
53-
Alternative store the access token in an environment variable and use the NLog [${environment:variable=OAuthClientSecret}](https://github.com/NLog/NLog/wiki/Environment-layout-renderer) instead of NLog GDC.
54-
52+
Before using OAuth2 authentication, make sure to acquire an access token from your email provider (e.g., Gmail, Outlook).
53+
This can be implemented with a [Custom NLog Layout Renderer](https://github.com/NLog/NLog/wiki/How-to-write-a-custom-layout-renderer),
54+
or by storing the details in [environment variable](https://github.com/NLog/NLog/wiki/Environment-layout-renderer) or [NLog Global Diagnostics Context (GDC)](https://github.com/NLog/NLog/wiki/Gdc-layout-renderer)
55+
and point `SmtpUserName` and `SmtpPassword` to these locations.
5556
- [Using OAuth2 With Microsoft Outlook Exchange](https://github.com/jstedfast/MailKit/blob/master/ExchangeOAuth2.md)
5657
- [Using OAuth2 With Google GMail](https://github.com/jstedfast/MailKit/blob/master/GMailOAuth2.md)
5758

0 commit comments

Comments
 (0)