oauth2

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2018 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckScopes added in v0.9.10

func CheckScopes(possibleScopes []string, authorizedScopes []string) bool

CheckScopes checks whether one of the possibleScopes is in the authorized scopes list

func GetScopesFromJWT added in v0.9.10

func GetScopesFromJWT(token *jwt.Token) (scopes []string)

func GetScopestringFromJWT added in v0.9.10

func GetScopestringFromJWT(token *jwt.Token) (scopestring string)

GetScopestringFromJWT turns the scopes from a jwt in to a commaseperated scopestring

func GetValidJWT

func GetValidJWT(r *http.Request, publicKey *ecdsa.PublicKey) (token *jwt.Token, err error)

GetValidJWT returns a validated ES384 signed jwt from the authorization header that needs to start with "bearer " If no jwt is found in the authorization header, nil is returned Validation against the supplied publickey is performed

func IgnoreExpired added in v0.9.11

func IgnoreExpired(err error) error

IgnoreExpired checks if the input error is only an expired error. Nil is returned in this case, else the original error

func SplitScopeString added in v0.9.10

func SplitScopeString(scopestring string) (scopeList []string)

SplitScopeString takes a comma seperated string representation of scopes and returns it as a slice

Types

This section is empty.

Jump to

Keyboard shortcuts

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