「应用安全」OAuth和OpenID Connect的全面比较(34)


// is 'native' uses a redirect URI whose scheme is
// 'http' the host port of the URI must be
// 'localhost'.
throw new Exception(
\"The host of the redirect URI is not 'localhost'.\");



// If the value of the 'application_type' attribute is neither
// 'web' or 'native'.
else
{
// As mentioned above Authlete allows 'unspecified' as a
// value of the 'application_type' attribute. Therefore
// no exception is thrown here.

8.2 。 其他的实施

在OpenID Connect中 , redirect_uri参数是必需的 , 关于如何检查呈现的重定向URI是否已注册的要求只是“简单字符串比较” 。 因此 , 如果您需要关注的只是OpenID Connect , 那么实现将非常简单 。 例如 , 在2016年10月在GitHub上赢得大约1700颗星并且已通过OpenID认证计划认证的IdentityServer3中 , 检查重定向URI的实现如下(摘自DefaultRedirectUriValidator.cs以及其他格式化新行) 。

public virtual Task<bool> IsRedirectUriValidAsync(

推荐阅读