summaryrefslogtreecommitdiff
path: root/internal/handlers/handler_oauth_revocation.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/handlers/handler_oauth_revocation.go')
-rw-r--r--internal/handlers/handler_oauth_revocation.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/internal/handlers/handler_oauth_revocation.go b/internal/handlers/handler_oauth_revocation.go
new file mode 100644
index 000000000..1dad867bc
--- /dev/null
+++ b/internal/handlers/handler_oauth_revocation.go
@@ -0,0 +1,24 @@
+package handlers
+
+import (
+ "net/http"
+
+ "github.com/ory/fosite"
+
+ "github.com/authelia/authelia/v4/internal/middlewares"
+)
+
+// OAuthRevocationPOST handles POST requests to the OAuth 2.0 Revocation endpoint.
+//
+// https://datatracker.ietf.org/doc/html/rfc7009
+func OAuthRevocationPOST(ctx *middlewares.AutheliaCtx, rw http.ResponseWriter, req *http.Request) {
+ var err error
+
+ if err = ctx.Providers.OpenIDConnect.Fosite.NewRevocationRequest(ctx, req); err != nil {
+ rfc := fosite.ErrorToRFC6749Error(err)
+
+ ctx.Logger.Errorf("Revocation Request failed with error: %+v", rfc)
+ }
+
+ ctx.Providers.OpenIDConnect.Fosite.WriteRevocationResponse(rw, err)
+}