errors

package
v0.0.0-...-85aee89 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenInvalid = "S0001"
	TokenExpired = "S0002"
)

Token Code

View Source
const (
	InvalidRequestCode          = "invalid_request"
	InvalidClientCode           = "invalid_client"
	InvalidTokenCode            = "invalid_token"
	InvalidScopeCode            = "invalid_scope"
	InvalidGrantCode            = "invalid_grant"
	InsufficientScopeCode       = "insufficient_scope"
	UnauthorizedClientCode      = "unauthorized_client"
	UnauthorizedUserCode        = "unauthorized_user"
	UnsupportedGrantTypeCode    = "unsupported_grant_type"
	UnsupportedResponseTypeCode = "unsupported_response_type"
	AccessDeniedCode            = "access_denied"
)

OAuth2 error code

Variables

View Source
var (
	// ErrInvalidToken for auth
	ErrInvalidToken = coreErrors.New(http.StatusUnauthorized, InvalidTokenCode, "Token invalid")
	// ErrExpiredToken for auth
	ErrExpiredToken = coreErrors.New(http.StatusUnauthorized, TokenExpired, "Token expired")
)

Functions

func InsufficientAuthentication

func InsufficientAuthentication(args ...string) error

InsufficientAuthentication 不充足的认证

func InvalidClient

func InvalidClient(args ...string) error

InvalidClient 无效的Client

func InvalidGrant

func InvalidGrant(args ...string) error

InvalidGrant 无效的授权

func InvalidRequest

func InvalidRequest(args ...string) error

InvalidRequest 无效的情况

func InvalidScope

func InvalidScope(args ...string) error

InvalidScope 无效的Scope

func InvalidToken

func InvalidToken(args ...string) error

InvalidToken 无效的Token,自定义提示信息

func OAuth2AccessDenied

func OAuth2AccessDenied(args ...string) error

OAuth2AccessDenied error

func UnsupportedGrantType

func UnsupportedGrantType(args ...string) error

UnsupportedGrantType 不支持的 grant type

Types

This section is empty.

Jump to

Keyboard shortcuts

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