[Registration] `invalid_redirect_uri` / `invalid_client_metadata` surface as `OIDErrorCodeOAuthOther`

未关闭 适合新手
#989 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
objective-c

调研方向

从验收标准中指定的映射方法 +[OIDErrorUtilities OAuthErrorCodeFromString:] 开始,并检查现有的 OAuth 错误代码常量。添加这两个注册错误映射,并使用针对两个错误字符串的 400 注册响应编写单元测试来覆盖它们。完成意味着完成过程在 OIDOAuthRegistrationErrorDomain 中收到 OIDErrorCodeOAuthInvalidRedirectURI 或 OIDErrorCodeOAuthInvalidClientMetadata,并且单元测试通过。

由索引模型根据 Issue 内容生成。

描述

bug

Acceptance Criteria

  • +[OIDErrorUtilities OAuthErrorCodeFromString:] maps invalid_redirect_uri to OIDErrorCodeOAuthInvalidRedirectURI and invalid_client_metadata to OIDErrorCodeOAuthInvalidClientMetadata.
  • A unit test covers both, via a 400 registration response.

Background
OIDErrorCodeOAuthInvalidRedirectURI (-12) and OIDErrorCodeOAuthInvalidClientMetadata (-13) exist in OIDErrorCodeOAuth, with doc comments pointing at OpenID Connect Dynamic Client Registration 1.0 section 3.3, but nothing ever produces them. The mapping table in OAuthErrorCodeFromString: has the ten RFC 6749 codes and stops there.

Repro steps: point performRegistrationRequest:completion: at a registration endpoint that answers 400 {"error":"invalid_redirect_uri"}, then inspect error.code in the completion.

Expected behaviour: error.code == OIDErrorCodeOAuthInvalidRedirectURI in OIDOAuthRegistrationErrorDomain. Same for invalid_client_metadata -> OIDErrorCodeOAuthInvalidClientMetadata.

Actual behaviour: error.code == OIDErrorCodeOAuthOther, so, callers can't tell the two spec'd registration errors apart from an unknown one.

Found while fixing #987.

主要语言
Objective-C
星标
2k
派生
863
平均合并
6 天 11 小时
30 天内合并 PR
5

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

openid/AppAuth-iOS 的其他 Issue

查看 openid/AppAuth-iOS 的全部 Issue

相似的 Issue

更多 Objective-C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。