oauth授权请求中什么时候可以省略redirect_uri?

When redirect_uri may be omitted in oauth authorization request?

看了The OAuth 2.0 Authorization Framework没看懂,当redirect_uri可能在oauth authorization中省略了。

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

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

当只有一个 redirect_uri 为客户端注册时,它可能会从授权请求中省略,因为提供者会明确知道将授权响应发送到哪里。

"OpenID Connect Core 1.0, 3.1.2.1. Authentication Request" 表示 redirect_uri 必需的 。因此,我的理解是,当授权请求应被视为 OpenID Connect 请求.

时,始终需要 redirect_uri 参数

当请求包含 scope 参数中的 openid 时,某个实现总是需要 redirect_uri 参数(即使注册的重定向 URI 的数量为 1)。之所以根据scope参数中是否包含openid来判断请求是OpenID Connect请求还是普通RFC 6749请求,原因是“3.1.2.1. Authentication Request”如下所示.

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.