TsgcHTTP_OAuth2_Server › Events

TsgcHTTP_OAuth2_Server Events

Events you can handle, grouped by purpose, followed by the full alphabetical list.

Request pipeline

NameDescription
OnOAuth2BeforeRequestFires before any OAuth2 endpoint processes an incoming HTTP request; lets the application inspect, rewrite or cancel the request.
OnOAuth2BeforeDispatchPageFires before an OAuth2 HTML page (sign-in, consent, device verification) is rendered so the application can customize the HTML.
OnOAuth2AuthenticationValidates user credentials submitted on the sign-in page during the authorize flow.
OnOAuth2UnauthorizedFires when a protected endpoint rejects a request because the bearer token is missing, invalid or expired.
OnOAuth2ResponseErrorFires when the server is about to return an OAuth2 error response (invalid_grant, invalid_client, access_denied, etc.) so the application can override status, body or headers.

Tokens

NameDescription
OnOAuth2AfterAccessTokenFires after the /token endpoint successfully issues an access token.
OnOAuth2AfterRefreshTokenFires after the /token endpoint successfully renews an access token using the refresh_token grant.
OnOAuth2AfterValidateAccessTokenFires after the server has validated an access token on a resource request and lets the application accept or override the result.
OnOAuth2AfterRevokeTokenFires after the /revoke endpoint processes a token revocation request (RFC 7009).
OnOAuth2AfterIntrospectTokenFires after the /introspect endpoint processes a token introspection request (RFC 7662).

Device Code

NameDescription
OnOAuth2DeviceAuthorizationFires after the /device_authorization endpoint issues a device_code and user_code pair (RFC 8628).
OnOAuth2DeviceCodeVerificationFires when the user submits a user_code on the device verification page (RFC 8628) so the application can authorize or deny the device.

DPoP

NameDescription
OnOAuth2ValidateDPoPFires when a resource request carries a DPoP proof header so the application can verify the proof-of-possession (RFC 9449).

All Events (alphabetical)

NameDescription
OnOAuth2AfterAccessTokenFires after the /token endpoint successfully issues an access token.
OnOAuth2AfterIntrospectTokenFires after the /introspect endpoint processes a token introspection request (RFC 7662).
OnOAuth2AfterRefreshTokenFires after the /token endpoint successfully renews an access token using the refresh_token grant.
OnOAuth2AfterRevokeTokenFires after the /revoke endpoint processes a token revocation request (RFC 7009).
OnOAuth2AfterValidateAccessTokenFires after the server has validated an access token on a resource request and lets the application accept or override the result.
OnOAuth2AuthenticationValidates user credentials submitted on the sign-in page during the authorize flow.
OnOAuth2BeforeDispatchPageFires before an OAuth2 HTML page (sign-in, consent, device verification) is rendered so the application can customize the HTML.
OnOAuth2BeforeRequestFires before any OAuth2 endpoint processes an incoming HTTP request; lets the application inspect, rewrite or cancel the request.
OnOAuth2DeviceAuthorizationFires after the /device_authorization endpoint issues a device_code and user_code pair (RFC 8628).
OnOAuth2DeviceCodeVerificationFires when the user submits a user_code on the device verification page (RFC 8628) so the application can authorize or deny the device.
OnOAuth2ResponseErrorFires when the server is about to return an OAuth2 error response (invalid_grant, invalid_client, access_denied, etc.) so the application can override status, body or headers.
OnOAuth2UnauthorizedFires when a protected endpoint rejects a request because the bearer token is missing, invalid or expired.
OnOAuth2ValidateDPoPFires when a resource request carries a DPoP proof header so the application can verify the proof-of-possession (RFC 9449).