mytokenlib

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: MIT Imports: 7 Imported by: 2

README

mytoken logo

License GitHub go.mod Go version Go Report DeepSource Release date Release version

mytokenlib

mytokenlib is a go library for communicating with amytoken server. mytoken is a central web service with the goal to easily obtain OpenID Connect access tokens across devices.

A mytoken command line client can be found at https://github.com/oidc-mytoken/client.

The mytoken server can be found at https://github.com/oidc-mytoken/server.

A demo instance of mytoken is running at https://mytoken.data.kit.edu/.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAccessTokenRequest

func NewAccessTokenRequest(issuer, mytoken string, scopes, audiences []string, comment string) api.AccessTokenRequest

Types

type MytokenError

type MytokenError struct {
	// contains filtered or unexported fields
}

MytokenError is a error type from the mytoken library

func (*MytokenError) Error

func (err *MytokenError) Error() string

type MytokenProvider

type MytokenProvider struct {
	api.MytokenConfiguration
}

func NewMytokenProvider

func NewMytokenProvider(url string) (*MytokenProvider, error)

func (*MytokenProvider) GetAccessToken

func (my *MytokenProvider) GetAccessToken(mytoken, oidcIssuer string, scopes, audiences []string, comment string) (string, error)

func (*MytokenProvider) GetMytoken

func (my *MytokenProvider) GetMytoken(req interface{}) (string, error)

func (*MytokenProvider) GetMytokenByAuthorizationFlow

func (my *MytokenProvider) GetMytokenByAuthorizationFlow(issuer string, restrictions api.Restrictions, capabilities, subtokenCapabilities api.Capabilities, responseType, name string, callbacks PollingCallbacks) (string, error)

func (*MytokenProvider) GetMytokenByMytoken

func (my *MytokenProvider) GetMytokenByMytoken(mytoken, issuer string, restrictions api.Restrictions, capabilities, subtokenCapabilities api.Capabilities, responseType, name string) (string, error)

func (*MytokenProvider) GetMytokenByTransferCode

func (my *MytokenProvider) GetMytokenByTransferCode(transferCode string) (string, error)

func (*MytokenProvider) InitAuthorizationFlow

func (my *MytokenProvider) InitAuthorizationFlow(issuer string, restrictions api.Restrictions, capabilities, subtokenCapabilities api.Capabilities, responseType, name string) (*api.AuthCodeFlowResponse, error)

func (*MytokenProvider) Poll

func (my *MytokenProvider) Poll(res api.PollingInfo, callback func(int64, int)) (string, error)

func (*MytokenProvider) PollOnce

func (my *MytokenProvider) PollOnce(pollingCode string) (string, bool, error)

func (*MytokenProvider) Revoke

func (my *MytokenProvider) Revoke(mytoken, oidcIssuer string, recursive bool) error

func (*MytokenProvider) TokeninfoHistory

func (my *MytokenProvider) TokeninfoHistory(mytoken string) (*api.TokeninfoHistoryResponse, error)

func (*MytokenProvider) TokeninfoIntrospect

func (my *MytokenProvider) TokeninfoIntrospect(mytoken string) (*api.TokeninfoIntrospectResponse, error)

func (*MytokenProvider) TokeninfoListMytokens

func (my *MytokenProvider) TokeninfoListMytokens(mytoken string) (*api.TokeninfoListResponse, error)

func (*MytokenProvider) TokeninfoSubtokens

func (my *MytokenProvider) TokeninfoSubtokens(mytoken string) (*api.TokeninfoTreeResponse, error)

type PollingCallbacks

type PollingCallbacks struct {
	Init     func(string) error
	Callback func(int64, int)
	End      func()
}

Jump to

Keyboard shortcuts

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