Documentation ¶
Index ¶
- Constants
- func APIKeyTokenRequest(apikey string, opts ...authentication.TokenOption) *authentication.TokenRequest
- func AuthorizationTokenRequest(code string, redirectURI string, opts ...authentication.TokenOption) *authentication.TokenRequest
- func OnetimePasscodeTokenRequest(passcode string, opts ...authentication.TokenOption) *authentication.TokenRequest
- func PasswordTokenRequest(username, password string, opts ...authentication.TokenOption) *authentication.TokenRequest
- func RefreshTokenRequest(refreshToken string, opts ...authentication.TokenOption) *authentication.TokenRequest
- func SetAccount(accountID string) authentication.TokenOption
- func SetIMSAccount(imsAccountID string) authentication.TokenOption
- func SetPhoneAuthToken(token string) authentication.TokenOption
- func SetSecurityCode(code string, vendor MFAVendor) authentication.TokenOption
- func SetSecurityQuestion(questionID int, answer string) authentication.TokenOption
- func SetTOTPCode(code string) authentication.TokenOption
- func SetVeriSignCode(code string) authentication.TokenOption
- type APIError
- type Config
- type Endpoint
- type Interface
- type MFAVendor
- type Requirement
- type Token
Constants ¶
View Source
const ( GrantTypePassword authentication.GrantType = "password" GrantTypeAPIKey authentication.GrantType = "urn:ibm:params:oauth:grant-type:apikey" GrantTypeOnetimePasscode authentication.GrantType = "urn:ibm:params:oauth:grant-type:passcode" GrantTypeAuthorizationCode authentication.GrantType = "authorization_code" GrantTypeRefreshToken authentication.GrantType = "refresh_token" GrantTypeDelegatedRefreshToken authentication.GrantType = "urn:ibm:params:oauth:grant-type:delegated-refresh-token" GrantTypeIdentityCookie authentication.GrantType = "urn:ibm:params:oauth:grant-type:identity-cookie" GrantTypeDerive authentication.GrantType = "urn:ibm:params:oauth:grant-type:derive" )
Grant types
View Source
const ( ResponseTypeIAM authentication.ResponseType = "cloud_iam" ResponseTypeUAA authentication.ResponseType = "uaa" ResponseTypeIMS authentication.ResponseType = "ims_portal" ResponseTypeDelegatedRefreshToken authentication.ResponseType = "delegated_refresh_token" )
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 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
func SetAccount ¶
func SetAccount(accountID string) authentication.TokenOption
func SetIMSAccount ¶
func SetIMSAccount(imsAccountID string) authentication.TokenOption
func SetPhoneAuthToken ¶
func SetPhoneAuthToken(token string) authentication.TokenOption
func SetSecurityCode ¶
func SetSecurityCode(code string, vendor MFAVendor) authentication.TokenOption
func SetSecurityQuestion ¶
func SetSecurityQuestion(questionID int, answer string) authentication.TokenOption
func SetTOTPCode ¶
func SetTOTPCode(code string) authentication.TokenOption
func SetVeriSignCode ¶
func SetVeriSignCode(code string) authentication.TokenOption
Types ¶
type APIError ¶
type APIError struct { ErrorCode string `json:"errorCode"` ErrorMessage string `json:"errorMessage"` ErrorDetails string `json:"errorDetails"` Requirements Requirement `json:"requirements"` }
type Config ¶
type Config struct { IAMEndpoint string TokenEndpoint string // Optional. Default value is <IAMEndpoint>/identity/token ClientID string ClientSecret string UAAClientID string UAAClientSecret string }
func DefaultConfig ¶
type Interface ¶
type Interface interface { GetEndpoint() (*Endpoint, error) GetToken(req *authentication.TokenRequest) (*Token, error) InitiateIMSPhoneFactor(req *authentication.TokenRequest) (authToken string, err error) }
type MFAVendor ¶
type MFAVendor string
type Requirement ¶
type Token ¶
type Token struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` TokenType string `json:"token_type"` Scope string `json:"scope"` Expiry time.Time `json:"expiration"` // Fields present when ResponseTypeUAA is set UAAToken string `json:"uaa_token"` UAARefreshToken string `json:"uaa_refresh_token"` // Fields present when ResponseTypeIMS is set IMSUserID int64 `json:"ims_user_id"` IMSToken string `json:"ims_token"` }
Click to show internal directories.
Click to hide internal directories.