From 8b5e33e7a8d49a10dc9ba0e80f99257cb49be0ef Mon Sep 17 00:00:00 2001 From: longze chen Date: Tue, 23 Jul 2019 07:07:46 -0400 Subject: [PATCH] Add token revoke endpoint Simply add a route /oauth/revoke that returns 204 since fakeCAS does not maintain its own database to store tokens. --- fakecas.go | 1 + views.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/fakecas.go b/fakecas.go index 4500de9..0d9fd57 100644 --- a/fakecas.go +++ b/fakecas.go @@ -51,6 +51,7 @@ func main() { e.POST("/login", LoginPOST) e.GET("/logout", Logout) e.GET("/oauth2/profile", OAuth) + e.POST("/oauth2/revoke", OAuthRevoke) e.GET("/p3/serviceValidate", ServiceValidate) fmt.Println("Expecting database", *DatabaseName, "to be running at", *DatabaseAddress) diff --git a/views.go b/views.go index 9f9241a..d22bea4 100644 --- a/views.go +++ b/views.go @@ -238,3 +238,7 @@ func OAuth(c echo.Context) error { Scope: scopes, }) } + +func OAuthRevoke(c echo.Context) error { + return c.NoContent(http.StatusNoContent) +}