implement remaining server methods
This commit is contained in:
parent
2b08c53e49
commit
6993769f06
3 changed files with 82 additions and 42 deletions
|
@ -131,6 +131,11 @@ func ParseTokenRevocationRequest(r *http.Request, revoker Revoker) (token, token
|
|||
}
|
||||
|
||||
func RevocationRequestError(w http.ResponseWriter, r *http.Request, err error) {
|
||||
statusErr := RevocationError(err)
|
||||
httphelper.MarshalJSONWithStatus(w, statusErr.parent, statusErr.statusCode)
|
||||
}
|
||||
|
||||
func RevocationError(err error) StatusError {
|
||||
e := oidc.DefaultToServerError(err, err.Error())
|
||||
status := http.StatusBadRequest
|
||||
switch e.ErrorType {
|
||||
|
@ -139,7 +144,7 @@ func RevocationRequestError(w http.ResponseWriter, r *http.Request, err error) {
|
|||
case oidc.ServerError:
|
||||
status = 500
|
||||
}
|
||||
httphelper.MarshalJSONWithStatus(w, e, status)
|
||||
return NewStatusError(e, status)
|
||||
}
|
||||
|
||||
func getTokenIDAndSubjectForRevocation(ctx context.Context, userinfoProvider UserinfoProvider, accessToken string) (string, string, bool) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue