Documentation
¶
Overview ¶
Package xoauth2 is Go library for generating XOAuth2 strings (for use in XOAUTH2 SASL auth schemes for IMAP/SMTP)
Copied from https://github.com/sqs/go-xoauth2
Index ¶
Constants ¶
const XOAuth2 = "XOAUTH2"
The XOAUTH2 mechanism name.
Variables ¶
This section is empty.
Functions ¶
func NewXOAuth2Client ¶
func NewXOAuth2Client(opt *XOAuth2Options) *xoauth2Client
An implementation of the OAUTHBEARER authentication mechanism, as described in RFC 7628.
func OAuth2String ¶
OAuth2String generates an unencoded XOAuth2 string of the form
"user=" {User} "^Aauth=Bearer " {Access Token} "^A^A"
as defined at https://developers.google.com/google-apps/gmail/xoauth2_protocol#the_sasl_xoauth2_mechanism (^A represents a Control+A (\001)).
The function XOAuth2String in this package returns the base64 encoding of this string.
func XOAuth2String ¶
XOAuth2String generates a base64-encoded XOAuth2 string suitable for use in SASL XOAUTH2, as defined at https://developers.google.com/google-apps/gmail/xoauth2_protocol#the_sasl_xoauth2_mechanism.
(Use the base64 encoding mechanism defined in RFC 4648.)