google oauth2 grant_type=authorization_代码在处理oauth2请求时返回错误

google oauth2 grant_type=authorization_代码在处理oauth2请求时返回错误,oauth,Oauth,代码片段如下所示: 发布url为 范围是’https://www.googleapis.com/auth/userinfo.profile https://www.google.com/m8/feeds/" 授予\类型作为授权\代码 代码来自谷歌 my %args = ( client_id => $config->{client_id}, client_secret => $config->{client_secret},

代码片段如下所示:

发布url为

范围是’https://www.googleapis.com/auth/userinfo.profile https://www.google.com/m8/feeds/"

授予\类型作为授权\代码

代码来自谷歌

my %args = ( client_id => $config->{client_id}, client_secret => $config->{client_secret}, redirect_uri => $config->{redirect_uri}, scope => $config->{scope}, grant_type => $config->{grant_type}, code => $code, ); my $ua = LWP::UserAgent->new; my $ua_response = $ua->post( $uri, \%args ); 我的%args=( client_id=>$config->{client_id}, client_secret=>$config->{client_secret}, 重定向_uri=>$config->{redirect_uri}, scope=>$config->{scope}, grant_type=>$config->{grant_type}, 代码=>$code, ); my$ua=LWP::UserAgent->new; 我的$ua\U响应=$ua->post($uri,\%args); 我得到的结果如下:(响应是html转义)

$VAR1=\bless({ “_content”=>“处理OAuth 2请求时出错处理OAuth 2请求时出错500”, “_headers”=>bless({“缓存控制”=>“无缓存,无存储,最大年龄=0,必须重新验证”,“客户端日期”=>“Wed,May 2012 09:21:26 GMT”,“客户端对等方”=>“173.194.74.84:443”,“客户端响应编号”=>1,“客户端ssl证书颁发者”=>”/C=ZA/O=Thawte咨询(Pty)有限公司/CN=sawte SGC CA',“客户端ssl证书主题”=>“/C=US/ST=California/L=Mountain View/O=Google Inc/CN=accounts.Google.com”,“客户端ssl密码”=>“RC4-SHA”,“客户端ssl警告”=>“对等证书未验证”,“连接”=>“关闭”,“内容类型”=>“文本/html;字符集=UTF-8”,“日期”=>“2012年5月16日星期三09:21:21 GMT”,“过期”=>“F”国际扶轮,1990年1月1日00:00:00 GMT,'pragma'=>'无缓存','服务器'=>'GSE','标题'=>'处理OAuth 2请求时出错','x-content-type-options'=>'nosniff','x-frame-options'=>'SAMEORIGIN',x-xss-protection'=>'1;mode=block'>,'HTTP::Headers'), “_msg'=>“处理OAuth 2请求时出错”, “_协议”=>“HTTP/1.1”, “_rc'=>500', “_请求”=>祝福({''u content'=>'grant\u type=authorization\u code&redirect\u uri=http%3A%2F%2Fwww.xxx.com%2fouth%2Fcallback%2Fgoogle&client\u secret=xxx&client\u id=xxx.apps.googleusercontent.com&code=4%2fsihum4zwlopiwlmi-gdGvKOfiY4M.cggfqhkt31qagrkxntqaax3e4e4qpbgi&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%2F%2F.glapis%2Fuserinfo.email+https%3A%2F%2Fwww.google.com%2Fm8%2Ffeeds%2F', “_headers'=>bless({'content length'=>424,'content type'=>'application/x-www-form-urlencoded','user agent'=>'libwww perl/6.04'},'HTTP::headers'), “\u方法”=>“POST”, “_uri”=>祝福(做{\(我的$o=)https://accounts.google.com/o/oauth2/token“)},'URI::https'), “\u uri\u canonical”=>${$VAR1}->{u请求}->{u uri}, 'HTTP::Request')},'HTTP::Response'); 事实上,它有时有效,但并非适用于所有情况


有什么问题吗?

在尝试为某些客户端获取访问令牌时,我们也面临同样的问题。这些客户端的位置是澳大利亚、日本、中国等,我们的服务器在德国。其他人也有同样的问题()不幸的是,这还没有被修复…

事实上,我们对失败进行了第二次请求,修复率为70-80%。不是全部。但更好。我面临着一个类似的问题,我随机收到一个“错误处理OAuth 2请求错误500”响应。它在开发期间和在第三台服务器上都可以正常工作。有人找到了修复方法吗? $VAR1 = \bless( { '_content' => '<HTML> <HEAD> <TITLE>Error processing OAuth 2 request</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1>Error processing OAuth 2 request</H1> <H2>Error 500</H2> </BODY> </HTML> ', '_headers' => bless( { 'cache-control' => 'no-cache, no-store, max-age=0, must-revalidate', 'client-date' => 'Wed, 16 May 2012 09:21:26 GMT', 'client-peer' => '173.194.74.84:443', 'client-response-num' => 1, 'client-ssl-cert-issuer' => '/C=ZA/O=Thawte Consulting (Pty) Ltd./CN=Thawte SGC CA', 'client-ssl-cert-subject' => '/C=US/ST=California/L=Mountain View/O=Google Inc/CN=accounts.google.com', 'client-ssl-cipher' => 'RC4-SHA', 'client-ssl-warning' => 'Peer certificate not verified', 'connection' => 'close', 'content-type' => 'text/html; charset=UTF-8', 'date' => 'Wed, 16 May 2012 09:21:21 GMT', 'expires' => 'Fri, 01 Jan 1990 00:00:00 GMT', 'pragma' => 'no-cache', 'server' => 'GSE', 'title' => 'Error processing OAuth 2 request', 'x-content-type-options' => 'nosniff', 'x-frame-options' => 'SAMEORIGIN', 'x-xss-protection' => '1; mode=block' }, 'HTTP::Headers' ), '_msg' => 'Error processing OAuth 2 request', '_protocol' => 'HTTP/1.1', '_rc' => '500', '_request' => bless( { '_content' => 'grant_type=authorization_code&redirect_uri=http%3A%2F%2Fwww.xxx.com%2Foauth%2Fcallback%2Fgoogle&client_secret=xxx&client_id=xxx.apps.googleusercontent.com&code=4%2FSihUM4Zw1OPiWLMi-gdGvKOfiY4M.cggfQHKT31QagrKXntQAax3e4-qpbgI&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.google.com%2Fm8%2Ffeeds%2F', '_headers' => bless( { 'content-length' => 424, 'content-type' => 'application/x-www-form-urlencoded', 'user-agent' => 'libwww-perl/6.04' }, 'HTTP::Headers' ), '_method' => 'POST', '_uri' => bless( do{\(my $o = 'https://accounts.google.com/o/oauth2/token')}, 'URI::https' ), '_uri_canonical' => ${$VAR1}->{'_request'}->{'_uri'} }, 'HTTP::Request' ) }, 'HTTP::Response' );