douyi3767 2014-10-02 21:35 采纳率: 0%
浏览 54

Google+ OAuth API - 错误400

I'm having a bit of a problem with the Google+ authentication and I can't seem to get my head around it.

I'm running a page on a WAMP server on my local machine. The website is being hosted on localhost:80

I setup the OAuth credentials as follows:

REDIRECT URIS  
http://localhost:80/oauth2callback

JAVASCRIPT ORIGINS 
http://localhost:80

So the callback and JS origin are both tuned to localhost:80 (as far as I'm aware).

However, when I use the Google+ signin button, I click on my Google account, but then am greeted with the following error message.

400. That’s an error.

Error: origin_mismatch

Request Details
=
from_login=1

e=3100077

scope=https://www.googleapis.com/auth/plus.login

redirect_uri=postmessage

state=886354831|0.2093651692

origin=http://localhost

as=6ab1e337782cd5f6

pli=1

request_visible_actions=http://schema.org/AddAction

hl=en

response_type=code token id_token gsession

cookie_policy=single_host_origin

proxy=oauth2relay1316100299

include_granted_scopes=true

client_id=/blanked this part for security/-jsaproji1sk0u1b8kjlh3m3n4i232m4b.apps.googleusercontent.com

authuser=0
That’s all we know.

Which outlines that the error is due to origin_mismatch. I've tried setting the OAuth origin&redirect credentials to localhost and localhost:80 respectively, but both give an error 400

Could someone with a bit more experience give me a hand? I'm still quite new to this

Thanks in advance, Sam

  • 写回答

1条回答 默认 最新

  • duanliang4009 2014-11-21 20:31
    关注

    Did you try setting the javascript origins also to: http://localhost not just http://localhost:80?

    The origins must be an exact match, and in your query it doesn't contain the port number as part of the origin.

    You can add multiple origins by adding one per line.
    - Dragonfire

    评论

报告相同问题?

悬赏问题

  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试