2

从 Github 官方文档中,这些是好/坏回调 url:

CALLBACK: http://example.com/path

GOOD: http://example.com/path
GOOD: http://example.com/path/subdir/other
BAD:  http://example.com/bar
BAD:  http://example.com/
BAD:  http://example.com:8080/path
BAD:  http://oauth.example.com:8080/path
BAD:  http://example.org

这是否意味着将子域作为回调 URL 是不好的?(要知道首页也是子域)

我在开发中使用域 example.com 测试了 oauth(在我的 /etc/hosts 中配置为使用 localhost),但是当我部署到使用子域(subdomain.mydomain.com)的生产环境时,我遇到了这个错误:

?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch&state=IDDbDeU3IyLe
4

0 回答 0