func (provider *HerokuProvider) CompleteAuth(data objx.Map) (*common.Credentials, error) {
	return oauth2.CompleteAuth(provider.TripperFactory(), data, provider.config, provider)
}
CompleteAuth takes a map of arguments that are used to
complete the authorisation process, completes it, and returns
the appropriate Credentials.
package heroku
import (
	"github.com/stretchr/gomniauth"
	"github.com/stretchr/gomniauth/common"
	"github.com/stretchr/gomniauth/oauth2"
	"github.com/stretchr/objx"
	"net/http"
)
const (
	herokuDefaultScope    string = "global"
	herokuName            string = "heroku"
	herokuDisplayName     string = "heroku"
	herokuAuthURL         string = "https://id.heroku.com/oauth/authorize"
	herokuTokenURL        string = "https://id.heroku.com/oauth/token"
	herokuEndpointProfile string = "https://api.heroku.com/account"
)
type HerokuProvider struct {
	config         *common.Config
	tripperFactory common.TripperFactory
}
func New(clientId, clientSecret, redirectUrl string) *HerokuProvider {
	p := new(HerokuProvider)
	p.config = &common.Config{Map: objx.MSI(
		oauth2.OAuth2KeyAuthURL, herokuAuthURL,
		oauth2.OAuth2KeyTokenURL, herokuTokenURL,
		oauth2.OAuth2KeyClientID, clientId,
		oauth2.OAuth2KeySecret, clientSecret,
		oauth2.OAuth2KeyRedirectUrl, redirectUrl,
		oauth2.OAuth2KeyScope, herokuDefaultScope,
		oauth2.OAuth2KeyAccessType, oauth2.OAuth2AccessTypeOnline,
		oauth2.OAuth2KeyApprovalPrompt, oauth2.OAuth2ApprovalPromptAuto,
		oauth2.OAuth2KeyResponseType, oauth2.OAuth2KeyCode)}
	return p
}
func (provider *HerokuProvider) TripperFactory() common.TripperFactory {
	if provider.tripperFactory == nil {
		provider.tripperFactory = new(oauth2.OAuth2TripperFactory)
	}
	return provider.tripperFactory
}
func (provider *HerokuProvider) PublicData(options map[string]interface{}) (interface{}, error) {
	return gomniauth.ProviderPublicData(provider, options)
}
func (provider *HerokuProvider) Name() string {
	return herokuName
}
func (provider *HerokuProvider) DisplayName() string {
	return herokuDisplayName
}
func (provider *HerokuProvider) GetBeginAuthURL(state *common.State, options objx.Map) (string, error) {
	if options != nil {
		scope := oauth2.MergeScopes(options.Get(oauth2.OAuth2KeyScope).Str(), herokuDefaultScope)
		provider.config.Set(oauth2.OAuth2KeyScope, scope)
	}
	return oauth2.GetBeginAuthURLWithBase(provider.config.Get(oauth2.OAuth2KeyAuthURL).Str(), state, provider.config)
}
func (provider *HerokuProvider) Get(creds *common.Credentials, endpoint string) (objx.Map, error) {
	return oauth2.Get(provider, creds, endpoint)
}
func (provider *HerokuProvider) GetUser(creds *common.Credentials) (common.User, error) {
	profileData, err := provider.Get(creds, herokuEndpointProfile)
	if err != nil {
		return nil, err
	}
	user := NewUser(profileData, creds, provider)
	return user, nil
}