Documentation
¶
Index ¶
Constants ¶
View Source
const AuthURL = "/authen/v1/index"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientSource ¶
type ClientSource interface {
TokenSource
Client() api.Client
}
ClientSource represents the source which provides a Client method to retrieve a Client.
type Config ¶
type Config struct {
// AppID is the app id of oauth2.
AppID string
// AppSecret is the app secret of oauth2.
AppSecret string
// AppTicket represents the ticket of the app.
// It's used to retrieve the tenant access token.
// If you're using the internal app, please leave it empty.
AppTicket string
// TenantKey represents the key of the tenant.
TenantKey string
// RedirectURL is the URL to redirect users going through
RedirectURL string
// Type represents the type of the app.
Type
// contains filtered or unexported fields
}
Config represents the configuration of the oauth2 service
func (*Config) AuthCodeURL ¶
AuthCodeURL is the URL to redirect users going through authentication
func (*Config) TenantTokenSource ¶
func (c *Config) TenantTokenSource(ctx context.Context) ClientSource
TenantTokenSource returns a token source that retrieves tokens from the tenant token endpoint
func (*Config) TokenSource ¶
func (c *Config) TokenSource(ctx context.Context, t *Token) ClientSource
TokenSource returns a TokenSource to grant token access
type TokenSource ¶
A TokenSource is anything that can return a token.
Click to show internal directories.
Click to hide internal directories.