Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultOAuthServerPort = 54520
DefaultOAuthServerPort is the default port for the OAuth server to listen for successful authentication
Variables ¶
This section is empty.
Functions ¶
func DefaultGetOAuthToken ¶
func DefaultGetOAuthToken(ctx context.Context, authURL string, tokenURL string, opts ...TokenOption) (*oauth2.Token, error)
DefaultGetOAuthToken provides a default behavior for calling GetOAuthToken, using the --interative flag to determine whether to use interactive mode or non-interactive mode.
func GetOAuthToken ¶
func GetOAuthToken(ctx context.Context, authURL string, tokenURL string, clientDetailsProvider client.DetailsProvider, opts ...TokenOption) (*oauth2.Token, error)
GetOAuthToken gets the OAuth token from the given OAuth server using the given client details provider.
Types ¶
type TokenOption ¶
type TokenOption func(*TokenOptions)
TokenOption is an option for GetOAuthToken
func WithOAuthServerPort ¶
func WithOAuthServerPort(port int) TokenOption
WithOAuthServerPort sets the port on which the OAuth server should run
func WithScopes ¶
func WithScopes(scopes ...string) TokenOption
WithScopes sets the OAuth scopes to be requested for the token.
type TokenOptions ¶
type TokenOptions struct {
// contains filtered or unexported fields
}
TokenOptions contains options for GetOAuthToken
Click to show internal directories.
Click to hide internal directories.