xoauth2

package module
v0.0.0-...-0911dad Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2012 License: BSD-2-Clause Imports: 3 Imported by: 5

README

go-xoauth2

Go library for generating strings for use in the XOAUTH2 authentication scheme, implemented by Google's Gmail IMAP and SMTP servers for OAuth2 authentication.

Usage

import (
       "xoauth2"
)

...

// returns unencoded string
xoauth2.OAuth2String("alice", "some-access-token")

// returns base64-encoded XOAUTH2 string, suitable for direct use in SASL XOAUTH2
xoauth2.XOAuth2String("alice", "some-access-token")

More information

See the XOAUTH2 protocol documentation for more information: https://developers.google.com/google-apps/gmail/xoauth2_protocol#the_sasl_xoauth2_mechanism

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OAuth2String

func OAuth2String(user, accessToken string) string

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.

The function XOAuth2String in this package returns the base64 encoding of this string.

func XOAuth2String

func XOAuth2String(user, accessToken string) string

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL