feat: add rp.RevokeToken

This commit is contained in:
David Sharnoff 2022-10-13 16:20:30 -07:00
parent 01021e71a0
commit 763d69b4ca
6 changed files with 90 additions and 5 deletions

View file

@ -113,8 +113,11 @@ func ParseTokenRevocationRequest(r *http.Request, revoker Revoker) (token, token
func RevocationRequestError(w http.ResponseWriter, r *http.Request, err error) {
e := oidc.DefaultToServerError(err, err.Error())
status := http.StatusBadRequest
if e.ErrorType == oidc.InvalidClient {
switch e.ErrorType {
case oidc.InvalidClient:
status = 401
case oidc.ServerError:
status = 500
}
httphelper.MarshalJSONWithStatus(w, e, status)
}