Documentation ¶
Overview ¶
Package xoauth calculates a valid signature for use with Gmail IMAP XOAUTH and other 2-legged OAUTH1 Google applications.
See http://github.com/agamz/xoauth for more information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateXOauthString ¶
func GenerateXOauthString(consumerKey, consumerSecret, oauthToken, oauthTokenSecret, user, proto, xoauth_requestor_id, nonce, timestamp string) string
GenerateXOauthString produces a cleartext string in the format required for OAUTH1 access. consumerKey and consumerSecret are used for 2-legged oauth. oauthToken and oauthTokenSecret are set to "" for 2-legged oauth but can be provided if known (e.g. a previously stored token). user is the email address, including the domain, whose data you are trying to access proto should be set to "imap" for accessing Gmail IMAP xoauth_requestor_id should be set to the user's email address for IMAP xoauth requests nonce and timestamp should be "" and will calculated automatically.
If you wish to encode the string ready to use with the IMAP "AUTHORIZE OAUTH <encoded_string>" command, then use the following:
xoauthstr := GenerateXOauthString(...) encoded_string := base64.StdEncoding.EncodeToString([]byte(xoauthstr))
Types ¶
This section is empty.