Categorygithub.com/indigo-dc/liboidcagent-go
modulepackage
0.5.0
Repository: https://github.com/indigo-dc/liboidcagent-go.git
Documentation: pkg.go.dev

# README

liboidcagent

liboidcagent is a go library for requesting OpenID Connect access token from oidc-agent from within go applications.

Documentation can be found at https://indigo-dc.gitbook.io/oidc-agent/api/api-go

Tests

The testing the library requires a working oidc-agent setup:

oidc-add <account shortname>
export OIDC_AGENT_ACCOUNT=<account shortname>
export OIDC_AGENT_ISSUER=<issuer of the account>
go test -v

# Functions

GetAccessToken gets an access token.
GetAccountInfos returns information about all issuers and their available account names and if those are loaded or not.
GetConfiguredAccounts returns a list of all accounts which are configured for oidc-agent.
GetLoadedAccounts returns a list of all accounts which are currently loaded by oidc-agent.
GetMytoken gets an mytoken.
GetMytokenResponse gets a mytoken response from the agent.
GetTokenResponse gets a TokenResponse.

# Structs

IssuerInfo is a type for holding information about a supported issuer.
MytokenRequest is used to request a mytoken from the agent.
MytokenResponse is a parse response from the oidc-agent compatible with the struct from the mytoken api, but with ExpiresAt set instead of ExpiresIn.
OIDCAgentError is an error type used for returning errors.
TokenRequest is used to request an access token from the agent.
TokenResponse is a parsed response from the oidc-agent.

# Type aliases

AccountInfoResponse holds information about the available accounts and issuers.