查询字符串问题中的自定义Oauth服务器和&符号

bre*_*rer 5 php laravel oauth2-playground

我一直试图将oauth2游乐场与Laravel oauth2-server捆绑使用,并遇到了一个问题.header('location:授权发生后,我正带着我回到谷歌.我正在进行重定向的字符串是

https://developers.google.com/oauthplayground/?state=1&code=d84024740acc22646b9636421406c88abeab9c8e 
Run Code Online (Sandbox Code Playgroud)

然而,当我到达它时,&已被替换&为导致操场不进入第2步.发生了什么?

Dan*_*ews 3

您是否尝试过使用 Laravel 的Redirect类而不是标头?它应该更好地处理编码:

Redirect::to('https://developers.google.com/oauthplayground/?state=1&code=d84024740acc22646b9636421406c88abeab9c8e');
Run Code Online (Sandbox Code Playgroud)