evesso

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

README

evesso

A small Go library to use EVE Online as an SSO provider.

Documentation

Overview

Package evesso is the main package of this library.

Index

Constants

View Source
const (
	// LiveServer contains the url of the EVE live server.
	LiveServer = "https://login.eveonline.com"

	// TestServer contains the url of the EVE test server.
	TestServer = "https://sisilogin.testeveonline.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OAuthResponse

type OAuthResponse struct {
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description"`
}

OAuthResponse is a generic OAuth response.

type SingleSignOn

type SingleSignOn struct {
	ClientID    string
	SecretKey   string
	RedirectURI string
	Server      string
}

SingleSignOn is a structure containing required credentials and settings to use the EVE SSO system.

func (*SingleSignOn) AccessToken

func (sso *SingleSignOn) AccessToken(code string, refreshToken bool) (response TokenResponse, expiryTime time.Time, characterID int, characterName string, err error)

AccessToken requests an OAuath access token as well as additional meta information given an authorization code or a refreshToken.

func (*SingleSignOn) Redirect

func (sso *SingleSignOn) Redirect(state string, scope *string) string

Redirect constructs an OAuth redirect url given a certain state and scope.

type TokenResponse

type TokenResponse struct {
	OAuthResponse

	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

TokenResponse is an OAuthResponse which contains an access token and/or a a refresh token.

Jump to

Keyboard shortcuts

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