我将Laravel Socialiste扩展为一个新的Oauth提供程序,并且遇到了更改授权URL的简单问题。覆盖Laravel RedirectResponse
由RedirectResponse
生成的URL具有%2C
代替+
,例如https://mycustomerprovider.com/oauth/authorize?scope=blah%2Cblahagain,对于范围定界符,因此失败,我使用的特定提供者,在本例mycustomprovider
。
任何人都知道如何修改此授权网址将%2C
更改为+
?
return Socialite::driver('mycustomprovider')->redirect();
如果var_dump(Socialite::driver('mycustomprovider')->redirect())
,这里就是它包含:
RedirectResponse {#886 ▼
#targetUrl: "http://"
+headers: ResponseHeaderBag {#888 ▶}
#content: """
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="UTF-8" />\n
<meta http-equiv="refresh" content="1;url=https://mycustomerprovider.com/oauth/authorize?scope=blah%2Cblahagain" />\n
\n
<title>Redirecting to https://mycustomerprovider.com/oauth/authorize?scope=blah%2Cblahagain</title>\n
</head>\n
<body>\n
Redirecting to <a href="https://mycustomerprovider.com/oauth/authorize?scope=blah%2Cblahagain</a>.\n
</body>\n
</html>
"""
#version: "1.0"
#statusCode: 302
#statusText: "Found"
#charset: null
}