passwordcredentials

package
v2.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package passwordcredentials implements the API Resource Owner Password Credentials access method.

This access method uses a user ID and password that can access several accounts.

Accounts are selected within the endpoint.Config.

conf := &passwordcredentials.Config{
	UserName: userName,
	Password: userPassword,
	ID:       applicationID,
	Secret:   applicationSecret,
	Config: endpoint.Config{
		Account: accountID,
		Scopes:  endpoint.InfrastructureScope,
	},
}

The application ID and secret are obtained by creating an Oauth application ID for your program.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	UserName string // The email address used to sign up to Brightbox
	Password string // Password, password and 2fa code, or temporary access token
	ID       string // Oauth application ID
	Secret   string // Oauth application secret
	endpoint.Config
}

Config includes the items necessary to authenticate using password credentials.

func (*Config) Client

func (c *Config) Client(ctx context.Context) (*http.Client, oauth2.TokenSource, error)

Client implements the [brightbox.Oauth2] access interface.

Jump to

Keyboard shortcuts

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