Skip to content

Commit

Permalink
Add token revoke endpoint
Browse files Browse the repository at this point in the history
Simply add a route /oauth/revoke that returns 204 since fakeCAS does
not maintain its own database to store tokens.
  • Loading branch information
cslzchen committed Jul 23, 2019
1 parent 60774f0 commit 8b5e33e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions fakecas.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions views.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,7 @@ func OAuth(c echo.Context) error {
Scope: scopes,
})
}

func OAuthRevoke(c echo.Context) error {
return c.NoContent(http.StatusNoContent)
}

0 comments on commit 8b5e33e

Please sign in to comment.