oauth授权请求中是否可以省略redirect_uri?

时间:2015-12-30 10:23:42

标签: oauth-2.0 specifications

我在redirect_uri中可能省略oauth authorization时,我读了The OAuth 2.0 Authorization Framework并且无法理解。

3.1.2.3. Dynamic Configuration说:如果已经注册了多个重定向URI,那么只有部分重定向    重定向URI已注册,或者没有重定向URI    已经注册,客户端必须包含一个重定向URI    授权请求使用" redirect_uri"请求参数。

所以," redirect_uri"必须始终包含请求参数?

2 个答案:

答案 0 :(得分:1)

如果只有一个redirect_uri注册了客户端,则可以从授权请求中省略它,因为提供商会明确知道在何处发送授权响应。

答案 1 :(得分:0)

" OpenID Connect Core 1.0,3.1.2.1. Authentication Request"说redirect_uri REQUIRED 。因此,我的理解是,当授权请求应被视为 OpenID Connect请求时,始终需要redirect_uri参数。

当请求在redirect_uri参数中包含openid时,某个实现始终需要scope参数(即使已注册的重定向URI的数量为1)。实现根据openid参数中是否包含scope来判断请求是OpenID Connect请求还是普通RFC 6749请求的原因是" 3.1.2.1. Authentication Request& #34;说如下。

scope
    REQUIRED. OpenID Connect requests MUST contain the openid scope value.
    If the openid scope value is not present, the behavior is entirely
    unspecified. Other scope values MAY be present. Scope values used
    that are not understood by an implementation SHOULD be ignored. See
    Sections 5.4 and 11 for additional scope values defined by this
    specification.