Categorygithub.com/lexis-project/yorcoidc
modulepackage
1.0.1
Repository: https://github.com/lexis-project/yorcoidc.git
Documentation: pkg.go.dev

# README

orch-service-yorc-oidc-client

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)
}

# Functions

GetClient returns a client of the Authentication and Authorization Infrastructure service.

# Structs

UserInfo provides details on the user info in an acess token.

# Interfaces

Client is the client interface to AAI service.