Documentation ¶
Index ¶
- func AccessToken(env *Environment, c *gin.Context) *oauth2.Token
- func ClearSessionRedirect(env *Environment, c *gin.Context, state string)
- func ConfigureOauth2(env *Environment) gin.HandlerFunc
- func CreateRandomStringWithNumberOfBytes(numberOfBytes int) (string, error)
- func CreateSessionRedirect(env *Environment, c *gin.Context, state string, redirectTo string) (err error)
- func FetchOAuth2Config(env *Environment, c *gin.Context) *oauth2.Config
- func FetchPrecalculatedState(env *Environment, c *gin.Context) (precaluclatedState string)
- func FetchRequiredScopes(env *Environment, c *gin.Context) (requiredScopes []string)
- func FetchSessionRedirect(env *Environment, c *gin.Context, state string) (redirectTo string, exists bool)
- func GetIdentity(env *Environment, c *gin.Context) *idp.Human
- func IdToken(env *Environment, c *gin.Context) *oidc.IDToken
- func IdTokenHint(env *Environment, c *gin.Context) string
- func IdpClientUsingAuthorizationCode(env *Environment, oauth2Delegator *oauth2.Config, c *gin.Context) *idp.IdpClient
- func IdpClientUsingClientCredentials(env *Environment, c *gin.Context) *idp.IdpClient
- func RegisterChallengeSession(env *Environment, c *gin.Context, state string, challenge string) (err error)
- func RequestId() gin.HandlerFunc
- func RequestLogger(env *Environment, appFields logrus.Fields) gin.HandlerFunc
- func RequestTokenUsingAuthorizationCode(env *Environment) gin.HandlerFunc
- func RequireIdentity(env *Environment) gin.HandlerFunc
- func RequireScopes(env *Environment, requiredScopes ...string) gin.HandlerFunc
- func StartAuthenticationSession(env *Environment, c *gin.Context, oauth2Config *oauth2.Config, ...) (authorizationCodeUrl *url.URL, err error)
- func UsePrecalculatedStateFromQuery(env *Environment, queryParamKey string) gin.HandlerFunc
- func ValidateSessionState(env *Environment, c *gin.Context, state string) (valid bool)
- type ChallengeSession
- type Environment
- type EnvironmentConstants
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessToken ¶
func AccessToken(env *Environment, c *gin.Context) *oauth2.Token
func ClearSessionRedirect ¶
func ClearSessionRedirect(env *Environment, c *gin.Context, state string)
func ConfigureOauth2 ¶
func ConfigureOauth2(env *Environment) gin.HandlerFunc
func CreateSessionRedirect ¶
func FetchOAuth2Config ¶
func FetchOAuth2Config(env *Environment, c *gin.Context) *oauth2.Config
func FetchPrecalculatedState ¶
func FetchPrecalculatedState(env *Environment, c *gin.Context) (precaluclatedState string)
func FetchRequiredScopes ¶
func FetchRequiredScopes(env *Environment, c *gin.Context) (requiredScopes []string)
func FetchSessionRedirect ¶
func GetIdentity ¶
func GetIdentity(env *Environment, c *gin.Context) *idp.Human
func IdTokenHint ¶
func IdTokenHint(env *Environment, c *gin.Context) string
func IdpClientUsingClientCredentials ¶
func IdpClientUsingClientCredentials(env *Environment, c *gin.Context) *idp.IdpClient
func RequestId ¶
func RequestId() gin.HandlerFunc
func RequestLogger ¶
func RequestLogger(env *Environment, appFields logrus.Fields) gin.HandlerFunc
func RequestTokenUsingAuthorizationCode ¶
func RequestTokenUsingAuthorizationCode(env *Environment) gin.HandlerFunc
This implements authorization code flow exchange controller functionality to prevent session storage on normal callback endpoints.
func RequireIdentity ¶
func RequireIdentity(env *Environment) gin.HandlerFunc
func RequireScopes ¶
func RequireScopes(env *Environment, requiredScopes ...string) gin.HandlerFunc
func UsePrecalculatedStateFromQuery ¶
func UsePrecalculatedStateFromQuery(env *Environment, queryParamKey string) gin.HandlerFunc
func ValidateSessionState ¶
func ValidateSessionState(env *Environment, c *gin.Context, state string) (valid bool)
Types ¶
type ChallengeSession ¶
func StartChallengeSession ¶
func StartChallengeSession(env *Environment, c *gin.Context, newChallengeSession ChallengeSession) (challengeSession *ChallengeSession, err error)
type Environment ¶
type Environment struct { Constants *EnvironmentConstants Logger *logrus.Logger Provider *oidc.Provider ClientId string ClientSecret string IdpConfig *clientcredentials.Config AapConfig *clientcredentials.Config }
type EnvironmentConstants ¶
type EnvironmentConstants struct { RequestIdKey string LogKey string AccessTokenKey string IdTokenKey string SessionStoreKey string // This holds the controller data SessionRedirectCsrfStoreKey string // This holds the data that is shared between controllers (redirects and state for CSRF over redirects) SessionChallengeStoreKey string // This holds the data from challenges SessionLogoutStateKey string ContextAccessTokenKey string ContextIdTokenKey string ContextIdTokenRawKey string ContextIdTokenHintKey string ContextIdentityKey string ContextOAuth2ConfigKey string ContextRequiredScopesKey string ContextPrecalculatedStateKey string }
Click to show internal directories.
Click to hide internal directories.