我正在開發一個使用ASP.NET身份的網站,該域名將與子域名一起使用,該子域名使用here中的一些信息來標識客戶端我有本地的子域名,但我無法獲得它使用OAuth。使谷歌Oauth在子域名本地工作
例如,如果我得到https://localhost:44301
並嘗試用Google登錄,一切都很好。在我的Google控制檯中,我在「Authorized JavaScript origins」下有https://localhost:44301
,在「Authorized redirect URIs」下有https://localhost:44301/signin-google
。但是,當我去https://foo.localhost:44301
谷歌將與迴應。
Error: invalid_request
Invalid parameter value for redirect_uri: Non-public domains not allowed: https://foo.localhost:44301/signin-google
當您嘗試登錄,我可以在谷歌控制檯添加https://foo.localhost:44301
到「授權JavaScript源」,但它不會讓我補充https://foo.localhost:44301/signin-google
下授權重定向的URI,因爲它會抱怨:
Invalid Redirect: https://foo.localhost:44301/signin-google must end with a public top-level domain (such as .com or .org)
其他一些questions and answers建議重定向所有子域爲OAuth的一個領域,但最好我想保持每個子域登錄。所以,如果你使用谷歌簽署它foo.mydomain.com
它將從bar.mydomain.com
獨立,我不認爲這將工作,如果我必須重定向到同一個單一的域(雖然我不知道這將工作,沒有單獨的Google的項目