示例#1
0
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
}
示例#2
0
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
}
示例#3
0
// 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
}
示例#4
0
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
}
示例#5
0
// 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
}