Documentation
¶
Index ¶
- Variables
- func AuthErrorResponse(w http.ResponseWriter, r *http.Request, authReq AuthenticateRequest, ...)
- func CheckUsernamePassword(username, password, authReqID string) error
- func ValidateClientRedirectURI(clientID string, redirectURI string) (bool, error)
- type AuthCode
- type AuthenticateRequest
- type Client
- type Token
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RequestStorage = make([]AuthenticateRequest, 0) ClientStorage = make([]Client, 0) UserStorage = make([]User, 0) AuthCodeStorage = make([]AuthCode, 0) TokenStorage = make([]Token, 0) )
View Source
var (
ErrAuthReqDoesNotExist = fmt.Errorf("auth request does not exist")
)
Functions ¶
func AuthErrorResponse ¶
func AuthErrorResponse(w http.ResponseWriter, r *http.Request, authReq AuthenticateRequest, errorCode string)
returns json object with errorCode, also it has redirection uri with error params errorCode - is OAuth Error code (https://www.rfc-editor.org/rfc/rfc6749#section-4.1.2), you can find then in pkg
func CheckUsernamePassword ¶
Types ¶
type AuthCode ¶
type AuthCode struct { ID string AuthRequestID string Scope []string ClientID string RedirectURI string State string }
type AuthCode string
func GenerateAuthCode ¶
func GenerateAuthCode(authReq AuthenticateRequest) (AuthCode, error)
add auth code obj to auth code storage and returns new created auth code
type AuthenticateRequest ¶
type AuthenticateRequest struct { Scope []string ResponseType []string ClientID string RedirectURI string State string AuthRequestID string }
func (AuthenticateRequest) GetID ¶
func (a AuthenticateRequest) GetID() string
type Token ¶
func SwitchCodeToToken ¶
Requires authRequest obj, deletes it and add generated token into token storage
Click to show internal directories.
Click to hide internal directories.