uaa

package
v0.0.0-...-a7f1bfa Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Overview

UAA client for token grants and revocation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	AuthURL string
	Client  *http.Client
}

Client makes requests to the UAA server at AuthURL

func (*Client) ClientCredentialGrant

func (u *Client) ClientCredentialGrant(clientId, clientSecret string) (string, error)

ClientCredentialGrant requests a token using client_credentials grant type

func (*Client) Metadata

func (u *Client) Metadata() (*Metadata, error)

func (*Client) PasscodeGrant

func (u *Client) PasscodeGrant(clientId, clientSecret, passcode string) (string, string, error)

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

func (u *Client) RevokeToken(accessToken string) error

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

func (md *Metadata) PasscodePrompt() string

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.

Jump to

Keyboard shortcuts

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