uaa

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GrantTypePassword          authentication.GrantType = "password"
	GrantTypeRefreshToken      authentication.GrantType = "refresh_token"
	GrantTypeAuthorizationCode authentication.GrantType = "authorization_code"
	GrantTypeIAMToken          authentication.GrantType = "iam_token"
)

Grant types

View Source
const (
	ResponseTypeUAA authentication.ResponseType = "uaa"
)

Response types

Variables

This section is empty.

Functions

func APIKeyTokenRequest

func APIKeyTokenRequest(apiKey string, opts ...authentication.TokenOption) *authentication.TokenRequest

func AuthorizationTokenRequest

func AuthorizationTokenRequest(code string, redirectURI string, opts ...authentication.TokenOption) *authentication.TokenRequest

func ConnectToIAM

func ConnectToIAM(iamAccessToken string) authentication.TokenOption

func OnetimePasscodeTokenRequest

func OnetimePasscodeTokenRequest(passcode string, opts ...authentication.TokenOption) *authentication.TokenRequest

func PasswordTokenRequest

func PasswordTokenRequest(username, password string, opts ...authentication.TokenOption) *authentication.TokenRequest

func RefreshTokenRequest

func RefreshTokenRequest(refreshToken string, opts ...authentication.TokenOption) *authentication.TokenRequest

Types

type APIError

type APIError struct {
	ErrorCode   string `json:"error"`
	Description string `json:"error_description"`
}

type Config

type Config struct {
	UAAEndpoint  string
	ClientID     string
	ClientSecret string
}

func DefaultConfig

func DefaultConfig(uaaEndpoint string) Config

type Interface

type Interface interface {
	GetToken(req *authentication.TokenRequest) (*Token, error)
	ConnectToIAM(iamAccessToken string) (*Token, error)
	DisconnectIAM(uaaToken string) error
}

func NewClient

func NewClient(config Config, restClient *rest.Client) Interface

type Token

type Token struct {
	AccessToken  string    `json:"access_token"`
	RefreshToken string    `json:"refresh_token"`
	TokenType    string    `json:"token_type"`
	Expiry       time.Time `json:"expires_in"`
	Scope        string    `json:"scope"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL