func (im extendedOAuth2) auth(ctx *importer.SetupContext) (*oauth.Config, error) { clientId, secret, err := ctx.Credentials() if err != nil { return nil, err } conf := im.oauthConfig conf.ClientId, conf.ClientSecret, conf.RedirectURL = clientId, secret, ctx.CallbackURL() return &conf, nil }
func auth(ctx *importer.SetupContext) (*oauth.Credentials, error) { clientId, secret, err := ctx.Credentials() if err != nil { return nil, err } return &oauth.Credentials{ Token: clientId, Secret: secret, }, nil }
// auth returns a new oauth.Config func auth(ctx *importer.SetupContext) (*oauth.Config, error) { clientId, secret, err := ctx.Credentials() if err != nil { return nil, err } return &oauth.Config{ ClientId: clientId, ClientSecret: secret, AuthURL: authURL, TokenURL: tokenURL, RedirectURL: ctx.CallbackURL(), }, nil }
func (im imp) auth(ctx *importer.SetupContext) (*oauth2.Config, error) { clientID, secret, err := ctx.Credentials() if err != nil { return nil, err } conf := &oauth2.Config{ Endpoint: google.Endpoint, RedirectURL: ctx.CallbackURL(), ClientID: clientID, ClientSecret: secret, Scopes: []string{scopeURL}, } return conf, nil }
// auth returns a new oauth2 Config func auth(ctx *importer.SetupContext) (*oauth2.Config, error) { clientID, secret, err := ctx.Credentials() if err != nil { return nil, err } return &oauth2.Config{ ClientID: clientID, ClientSecret: secret, Endpoint: oauth2.Endpoint{ AuthURL: authURL, TokenURL: tokenURL, }, RedirectURL: ctx.CallbackURL(), // No scope needed for foursquare as far as I can tell }, nil }