Documentation ¶
Index ¶
- func AccessTokenFromContext(ctx context.Context) *string
- func AccessTokenFromEchoContext(c echo.Context) *string
- func EnrichContextWithCredentials(ctx context.Context, result AuthenticationResult) context.Context
- func EnrichEchoContextWithCredentials(c echo.Context, result AuthenticationResult) echo.Context
- func UserFromContext(ctx context.Context) *models.User
- func UserFromEchoContext(c echo.Context) *models.User
- type AuthenticationResult
- type Scope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessTokenFromContext ¶
AccessTokenFromContext returns the access token model of the token used to authentication from a context. If no authentication was provided or the current context does not carry any access token information, nil will be returned instead.
func AccessTokenFromEchoContext ¶
func AccessTokenFromEchoContext(c echo.Context) *string
AccessTokenFromEchoContext returns the access token model of the token used to authentication from an echo context. If no authentication was provided or the current context does not carry any access token information, nil will be returned instead.
func EnrichContextWithCredentials ¶
func EnrichContextWithCredentials(ctx context.Context, result AuthenticationResult) context.Context
EnrichContextWithCredentials stores the provided credentials in the form of user and access token used for authentication in the give context and updates the logger associated with ctx to include the user's ID.
func EnrichEchoContextWithCredentials ¶
func EnrichEchoContextWithCredentials(c echo.Context, result AuthenticationResult) echo.Context
EnrichEchoContextWithCredentials stores the provided credentials in the form of user and access token user for authentication in the given echo context's request and updates the logger associated with c to include the user's ID.
func UserFromContext ¶
UserFromContext returns the user model of the currently authenticated user from a context. If no authentication was provided or the current context does not carry any user information, nil will be returned instead.
func UserFromEchoContext ¶
UserFromEchoContext returns the user model of the currently authenticated user from an echo context. If no authentication was provided or the current echo context does not carry any user information, nil will be returned instead.