0

当用户(“资源所有者”)明确拒绝身份验证请求时,应该将其传递给请求客户端(类似这样https://oauth2client.com/cb#error=access_denied)。

应该将哪些其他错误传递给 3rd-party-application?(临时)服务器错误怎么办?出于安全原因,是否存在不应回调的事件?

谢谢!

4

1 回答 1

2

你读过RFC吗?

请参见第4.1.2.1 节。授权码授予错误响应。它概述了您可以发回的错误代码。server_error或者temporarily_unavailable可能是您正在寻找的。OAUth2 安全建议并未说明不将其退回的原因。

If the request fails due to a missing, invalid, or mismatching
redirection URI, or if the client identifier is missing or invalid,
the authorization server SHOULD inform the resource owner of the
error and MUST NOT automatically redirect the user-agent to the
invalid redirection URI.

If the resource owner denies the access request or if the request
fails for reasons other than a missing or invalid redirection URI,
the authorization server informs the client by adding the following
parameters to the query component of the redirection URI using the
"application/x-www-form-urlencoded" format, per Appendix B:

error
     REQUIRED.  A single ASCII [USASCII] error code from the
     following:

     invalid_request
           The request is missing a required parameter, includes an
           invalid parameter value, includes a parameter more than
           once, or is otherwise malformed.
     unauthorized_client
           The client is not authorized to request an authorization
           code using this method.

     access_denied
           The resource owner or authorization server denied the
           request.

     unsupported_response_type
           The authorization server does not support obtaining an
           authorization code using this method.

     invalid_scope
           The requested scope is invalid, unknown, or malformed.

     server_error
           The authorization server encountered an unexpected
           condition that prevented it from fulfilling the request.
           (This error code is needed because a 500 Internal Server
           Error HTTP status code cannot be returned to the client
           via an HTTP redirect.)

     temporarily_unavailable
           The authorization server is currently unable to handle
           the request due to a temporary overloading or maintenance
           of the server.  (This error code is needed because a 503
           Service Unavailable HTTP status code cannot be returned
           to the client via an HTTP redirect.)

     Values for the "error" parameter MUST NOT include characters
     outside the set %x20-21 / %x23-5B / %x5D-7E.
于 2012-12-03T21:55:14.283 回答