func (t OAuthGrantType) UsesTokenEndpoint() bool {
	switch t {
	case OAuthAuthzCodeGrant:
		return true
	case OAuthOwnerPasswordGrant:
		return true
	default:
		return false
	}
}
UsesTokenEndpoint returns true if the receiving grant type makes
use of the token endpoint from the client configuration, and thus
if the authorization endpoint ought to be required.
package disco
import (
	"fmt"
	"net/url"
	"strings"
	"golang.org/x/oauth2"
)
type OAuthClient struct {
	ID string
	AuthorizationURL *url.URL
	TokenURL *url.URL
	MinPort, MaxPort uint16
	SupportedGrantTypes OAuthGrantTypeSet
}
func (c *OAuthClient) Endpoint() oauth2.Endpoint {
	ep := oauth2.Endpoint{
		AuthStyle: oauth2.AuthStyleInParams,
	}
	if c.AuthorizationURL != nil {
		ep.AuthURL = c.AuthorizationURL.String()
	}
	if c.TokenURL != nil {
		ep.TokenURL = c.TokenURL.String()
	}
	return ep
}
type OAuthGrantType string
const (
	OAuthAuthzCodeGrant = OAuthGrantType("authz_code")
	OAuthOwnerPasswordGrant = OAuthGrantType("password")
)
func (t OAuthGrantType) UsesAuthorizationEndpoint() bool {
	switch t {
	case OAuthAuthzCodeGrant:
		return true
	case OAuthOwnerPasswordGrant:
		return false
	default:
		return false
	}
}