Documentation ¶
Index ¶
- Constants
- Variables
- func ToJwt(claims jwt.MapClaims, key crypto.PrivateKey) string
- type AccessTokenReq
- type AccessTokenResp
- type AttrProfile
- type AuthorizationReq
- type AuthorizationResp
- type Client
- type ClientOauthConf
- type ClientSamlConf
- type ErrorResp
- type OauthScope
- type OauthSilo
- func (osl *OauthSilo) AddAppToSsoSession(jti string, spIssuer string, sas base.SamlAppSession)
- func (osl *OauthSilo) Close()
- func (osl *OauthSilo) DeleteOauthSession(jti string) bool
- func (osl *OauthSilo) DeleteSsoSession(jti string) bool
- func (osl *OauthSilo) GetOauthSession(jti string) *base.RbacSession
- func (osl *OauthSilo) GetSsoSession(jti string) *base.RbacSession
- func (osl *OauthSilo) HasGrantCodeId(creationTime int64, gcIvAsId []byte) bool
- func (osl *OauthSilo) IsRevokedSession(jti string) bool
- func (osl *OauthSilo) RevokeOauthSession(jti string)
- func (osl *OauthSilo) StoreGrantCodeId(creationTime int64, gcIvAsId []byte) (err error)
- func (osl *OauthSilo) StoreOauthSession(session *base.RbacSession)
- func (osl *OauthSilo) StoreSsoSession(session *base.RbacSession)
Constants ¶
View Source
const ( AUTHORIZATION_CODE = "authorization_code" IMPLICIT = "implicit" RES_OWN_PASS_CRED = "resource_owner_password_credentials" CLIENT_CRED = "client_credentials" )
View Source
const ( ERR_INVALID_REQUEST = "invalid_request" ERR_UNAUTHORIZED_CLIENT = "unauthorized_client" ERR_ACCESS_DENIED = "access_denied" ERR_UNSUPPORTED_RESPONSE_TYPE = "unsupported_response_type" ERR_INVALID_SCOPE = "invalid_scope" ERR_SERVER_ERROR = "server_error" ERR_TEMPORARILY_UNAVAILABLE = "temporarily_unavailable" )
Variables ¶
Functions ¶
func ToJwt ¶
func ToJwt(claims jwt.MapClaims, key crypto.PrivateKey) string
Types ¶
type AccessTokenReq ¶
type AccessTokenReq struct { GrantType string `json:"grant_type"` Code string `json:"code"` RedUri string `json:"redirect_uri"` ClientId string `json:"client_id"` Secret string `json:"client_secret"` }
func ParseAccessTokenReq ¶
func ParseAccessTokenReq(r *http.Request) (atr *AccessTokenReq, err error)
type AccessTokenResp ¶
type AccessTokenResp struct { AcToken string `json:"access_token"` IdToken string `json:"id_token,omitempty"` TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in,omitempty"` }
func (*AccessTokenResp) Serialize ¶
func (atr *AccessTokenResp) Serialize() []byte
type AuthorizationReq ¶
type AuthorizationReq struct { RespType string `json:"response_type"` ClientId string `json:"client_id"` RedUri string `json:"redirect_uri"` Scopes map[string]int `json:"scope"` State string `json:"state"` // OIDC specific parameters Nonce string Display string Prompt string ResponseMode string `json:"response_mode"` }
func ParseAuthzReq ¶
func ParseAuthzReq(r *http.Request) (areq *AuthorizationReq)
type AuthorizationResp ¶
type Client ¶
type Client struct { Id string `json:"id"` Name string `json:"name"` Time int64 `json:"time"` Desc string `json:"desc"` HomeUrl string `json:"homeurl"` Icon string `json:"icon"` GroupIds map[string]int Oauth *ClientOauthConf Saml *ClientSamlConf }
type ClientOauthConf ¶
type ClientOauthConf struct { Secret string `json:"secret"` RedUri string `json:"redUri"` TokenValidity int64 `json:"tokenValidity"` // the life time of an OAuth token in seconds ServerSecret []byte `json:"-"` // this secret is used as a key HasQueryInUri bool `json:"-"` // flag to indicate if there is query part in the path ConsentRequired bool `json:"consentRequired"` Attributes map[string]*base.SsoAttr `json:"attrs"` }
type ClientSamlConf ¶
type ErrorResp ¶
type ErrorResp struct { Err string `json:"error"` Desc string `json:"error_description"` Uri string `json:"error_uri"` State string `json:"state"` }
func ValidateAuthReq ¶
func ValidateAuthReq(areq *AuthorizationReq) *ErrorResp
func (*ErrorResp) BuildErrorUri ¶
type OauthScope ¶
type OauthSilo ¶
type OauthSilo struct {
// contains filtered or unexported fields
}
func (*OauthSilo) AddAppToSsoSession ¶
func (osl *OauthSilo) AddAppToSsoSession(jti string, spIssuer string, sas base.SamlAppSession)
func (*OauthSilo) DeleteOauthSession ¶
func (*OauthSilo) DeleteSsoSession ¶
func (*OauthSilo) GetOauthSession ¶
func (osl *OauthSilo) GetOauthSession(jti string) *base.RbacSession
func (*OauthSilo) GetSsoSession ¶
func (osl *OauthSilo) GetSsoSession(jti string) *base.RbacSession
func (*OauthSilo) HasGrantCodeId ¶
func (*OauthSilo) IsRevokedSession ¶
func (*OauthSilo) RevokeOauthSession ¶
func (*OauthSilo) StoreGrantCodeId ¶
func (*OauthSilo) StoreOauthSession ¶
func (osl *OauthSilo) StoreOauthSession(session *base.RbacSession)
func (*OauthSilo) StoreSsoSession ¶
func (osl *OauthSilo) StoreSsoSession(session *base.RbacSession)
Click to show internal directories.
Click to hide internal directories.