Skip to content

client used by the orchestrator plugins above, to validate/exchange/refresh/get info on OpenID Connect tokens

License

Notifications You must be signed in to change notification settings

lexis-project/orch-service-yorc-oidc-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

orch-service-yorc-oidc-client

DOI

OpenID connect client used by Yorc LEXIS plugins.

Acknowledgement

This code repository is a result / contains results of the LEXIS project. The project has received funding from the European Union’s Horizon 2020 Research and Innovation programme (2014-2020) under grant agreement No. 825532.

Usage

Installation

go get github.com/lexis-project/yorcoidc

Importing

 import "github.com/lexis-project/yorcoidc"

Get a Client

 client := yorcoidc.GetClient(yorcDeploymentID, url, clientID, clientSecret, realm)

Features

// Client is the client interface to AAI service
type Client interface {
	// ExchangeToken exchanges a token to get an access and a refresh token for this client
	ExchangeToken(ctx context.Context, accessToken string) (string, string, error)
	// IsAccessTokenValid checks if an access token is still valid
	IsAccessTokenValid(ctx context.Context, accessToken string) (bool, error)
	// RefreshToken refreshes the access token
	RefreshToken(ctx context.Context) (string, string, error)
	// GetAccessToken returns the access token
	GetAccessToken() (string, error)
	// GetRefreshToken returns the refresh token
	GetRefreshToken() (string, error)
	// GetUserInfo returns info on the user (name, attributes, etc..)
	GetUserInfo(ctx context.Context, accessToken string) (UserInfo, error)
}

About

client used by the orchestrator plugins above, to validate/exchange/refresh/get info on OpenID Connect tokens

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages