indieauth

package
v0.0.0-...-edf5a02 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAuthenticationURL

func CreateAuthenticationURL(authURL url.URL, meURL, clientID, redirectURI, state string) string

CreateAuthenticationURL builds the url for authentication

func CreateAuthorizationURL

func CreateAuthorizationURL(authURL url.URL, meURL, clientID, redirectURI, state, scope string) string

CreateAuthorizationURL builds the url for authorization

Types

type Endpoints

type Endpoints struct {
	Me                    string `json:"me"`
	AuthorizationEndpoint string `json:"authorization_endpoint"`
	TokenEndpoint         string `json:"token_endpoint"`
	MicropubEndpoint      string `json:"micropub_endpoint"`
	MicrosubEndpoint      string `json:"microsub_endpoint"`
}

Endpoints contain the endpoints used by Ekster

func GetEndpoints

func GetEndpoints(me *url.URL) (Endpoints, error)

GetEndpoints returns the endpoints for the me url

type TokenResponse

type TokenResponse struct {
	Me               string `json:"me"`
	AccessToken      string `json:"access_token"`
	TokenType        string `json:"token_type"`
	Scope            string `json:"scope"`
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description"`
}

TokenResponse contains the response from a token request to an IndieAuth server

func Authorize

func Authorize(me *url.URL, endpoints Endpoints, clientID, scope string) (TokenResponse, error)

Authorize allows you to get the token from Indieauth through the command line

Jump to

Keyboard shortcuts

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