orcid

package
v0.9.1-0...-cc718b5 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package orcid implements the ORCID authentication API.

See also:

https://github.com/ORCID/ORCID-Source/blob/master/orcid-model/src/main/resources/record_2.0/README.md#scopes

Index

Constants

View Source
const (
	AuthUrl  = "https://orcid.org/oauth/authorize"
	TokenUrl = "https://orcid.org/oauth/token"
)

Endpoints for ORCID production API

Variables

This section is empty.

Functions

This section is empty.

Types

type OrcidClient

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

func NewOrcidClient

func NewOrcidClient(redirectUrl string) (*OrcidClient, error)

func (*OrcidClient) Auth

func (client *OrcidClient) Auth() http.HandlerFunc

Auth sends the user to the OAuth auth endpoint.

func (*OrcidClient) Callback

func (client *OrcidClient) Callback() http.HandlerFunc

Callback handles the OAuth callback from the token endpoint.

func (*OrcidClient) GetApiClient

func (client *OrcidClient) GetApiClient(ctx context.Context, token *oauth2.Token) *http.Client

GetApiClient takes a context and token and returns a ready HTTP client for the oauth API.

func (*OrcidClient) SetLogger

func (client *OrcidClient) SetLogger(logger zerolog.Logger)

SetLogger assigns a logger to the service. It is not save to call this after instantiating any HTTP handlers.

Jump to

Keyboard shortcuts

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