Documentation
¶
Overview ¶
UAA client for token grants and revocation
Index ¶
- type Client
- func (u *Client) ClientCredentialGrant(clientId, clientSecret string) (string, error)
- func (u *Client) Metadata() (*Metadata, error)
- func (u *Client) PasscodeGrant(clientId, clientSecret, passcode string) (string, string, error)
- func (u *Client) PasswordGrant(clientId, clientSecret, username, password string) (string, string, error)
- func (u *Client) RefreshTokenGrant(clientId, clientSecret, refreshToken string) (string, string, error)
- func (u *Client) RevokeToken(accessToken string) error
- type Metadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client makes requests to the UAA server at AuthURL
func (*Client) ClientCredentialGrant ¶
ClientCredentialGrant requests a token using client_credentials grant type
func (*Client) PasscodeGrant ¶
PasscodeGrant requests an access token and refresh token using passcode grant type
func (*Client) PasswordGrant ¶
func (u *Client) PasswordGrant(clientId, clientSecret, username, password string) (string, string, error)
PasswordGrant requests an access token and refresh token using password grant type
func (*Client) RefreshTokenGrant ¶
func (u *Client) RefreshTokenGrant(clientId, clientSecret, refreshToken string) (string, string, error)
RefreshTokenGrant requests a new access token and refresh token using refresh_token grant type
func (*Client) RevokeToken ¶
RevokeToken revokes the given access token
type Metadata ¶
type Metadata struct { Links struct { Login string `json:"login"` } `json:"links"` Prompts struct { Passcode []string `json:"passcode"` } `json:"prompts"` }
Metadata captures the data returned by the GET /info on a UAA server This fields are not exhaustive and can added to over time. See: https://docs.cloudfoundry.org/api/uaa/version/4.6.0/index.html#server-information
func (*Metadata) PasscodePrompt ¶
PasscodePrompt returns a prompt to tell the user where to get a passcode from. If not present in the metadata (PCF installation don't seem to return it), will attempt to contruct a plausible URL.