June 2017
Intermediate to advanced
400 pages
10h 32m
English
These steps cover writing and running your application:
package oauthstore import ( "context" "net/http" "golang.org/x/oauth2" ) // Config wraps the default oauth2.Config // and adds our storage type Config struct { *oauth2.Config Storage } // Exchange stores a token after retrieval func (c *Config) Exchange(ctx context.Context, code string) (*oauth2.Token, error) { token, err := c.Config.Exchange(ctx, code) if err != nil {