redirector

package
v3.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// URLToken in the query of the redirectURL gets replaced with the original request URL, escaped as a query parameter.
	// Example use: https://www.example.com/login?then=${url}
	URLToken = "${url}"

	// QueryToken in the query of the redirectURL gets replaced with the original request URL, unescaped.
	// Example use: https://www.example.com/sso/oauth/authorize?${query}
	QueryToken = "${query}"
)

Variables

This section is empty.

Functions

func NewChallenger

func NewChallenger(baseRequestURL *url.URL, redirectURL string) oauthhandlers.AuthenticationChallenger

NewChallenger returns an oauthhandlers.AuthenticationChallenger that returns a Location header to the specified redirectURL. Request URLs missing scheme/host, or with relative paths are resolved relative to the baseRequestURL, if specified. The following tokens are replaceable in the query of the redirectURL:

${url} is replaced with the current request URL, escaped as a query parameter. Example: https://www.example.com/login?then=${url}
${query} is replaced with the current request query, unescaped. Example: https://www.example.com/sso/oauth/authorize?${query}

func NewRedirector

func NewRedirector(baseRequestURL *url.URL, redirectURL string) oauthhandlers.AuthenticationRedirector

NewRedirector returns an oauthhandlers.AuthenticationRedirector that redirects to the specified redirectURL. Request URLs missing scheme/host, or with relative paths are resolved relative to the baseRequestURL, if specified. The following tokens are replaceable in the query of the redirectURL:

${url} is replaced with the current request URL, escaped as a query parameter. Example: https://www.example.com/login?then=${url}
${query} is replaced with the current request query, unescaped. Example: https://www.example.com/sso/oauth/authorize?${query}

Types

This section is empty.

Jump to

Keyboard shortcuts

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