login

package
v0.0.0-...-21c0a40 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package login provides functions and methods for LTI's modified OpenID Connect login flow.

Index

Constants

View Source
const (
	StateCookieName       = "stateCookie"
	LegacyStateCookieName = StateCookieName + "-legacy"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Login

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

A Login implements an http.Handler that can be easily associated with a tool URI such as /services/lti/login/.

func New

func New(cfg datastore.Config) *Login

New creates a new login object. If the passed Config has zero-value store interfaces, fall back on the in-memory nonpersistent.DefaultStore.

func (*Login) JSRedirect

func (l *Login) JSRedirect(w http.ResponseWriter, r *http.Request) (string, error)

JSRedirect will return JS code to perform the redirect.

func (*Login) RedirectURI

func (l *Login) RedirectURI(r *http.Request) (string, http.Cookie, error)

RedirectURI extracts the form data from the initial login request and returns a auth redirect URI and state cookie. The login must cache the "nonce" locally and include it in the response.

func (*Login) ServeHTTP

func (l *Login) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP makes Login an http.Handler so that it can easily be associated with tool URI, e.g., /services/lti/login/. The handler must set the "state" in a cookie (in addition to including it in the response) and the two will be compared in the launch.

Jump to

Keyboard shortcuts

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