2014-04-26 11 views
6

सभी,गूगल OAuth2 redirect_uri_mismatch अंक

इम गूगल के माध्यम से प्रमाणित करने के लिए प्रयास कर रहा पर एक 400 redirect_url_mismatch त्रुटि मिल रही है। मैं इस प्रक्रिया को प्राप्त करने के लिए एक django अनुप्रयोग के माध्यम से अजगर-सामाजिक-एथ का उपयोग कर रहा हूँ।

सबकुछ सुचारू रूप से काम करता है, जब तक कि मैं उस प्रक्रिया के अंतिम चरण तक नहीं पहुंच जाता जहां मैंने redirect_uri_mismatch समस्या को मारा।

Google पर, मुझे यह संदेश प्राप्त होता है।

"The redirect URI in the request: http://localhost:8000/something/complete/google-oauth2/ did not match a registered redirect URI"

`Request Details 
from_login=1 
scope=https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile 
response_type=code 
redirect_uri=http://localhost:8000/something/complete/google-oauth2/ 
state=qT1RLLMa72F8NxFFubHwCVe3GgLDNcgZ 
as=-55f896f3314b21af 
pli=1 
client_id=160177117398 
authuser=0 
hl=en` 

नीचे शामिल ग्राहक आईडी के अनुप्रेषित यूआरआई का एक स्क्रीनशॉट है।

enter image description here

क्या मैं गलत कर रहा हूँ?

धन्यवाद!

उत्तर

2

सुनिश्चित करें कि आप

url('', include('social.apps.django_app.urls', namespace='social')), 

रूप urls.py में सामाजिक लेखन जोड़ा हैं और इस console.developers.google.com पर यहाँ ध्यान दें Authorized redirect URIshttp://localhost:8000/something/complete/google-oauth2/

+0

धन्यवाद, आखिरी/'google-oauth2 /' था जो मैं याद कर रहा था। –

1

एक करने के लिए बात यह है कि सेट रीडायरेक्ट यूआरएल अंतिम पिछला स्लैश तक बिल्कुल वही होना चाहिए। मेरे मामले में, यह http://localhot:8000/something/complete/google-oauth2 जैसा था
http://localhot:8000/something/complete/google-oauth2 यह परिणाम redirect_uri_mismatch में हुआ था।

यूआरएल को पुनर्निर्देशित करने के लिए कंसोल में http: और https: को परिभाषित करें क्योंकि सामाजिक ऑथ द्वारा जेनरेट किया गया यूआरएल अभी भी आपके सर्वर में एसएसएल सेटिंग के बावजूद http भेजता है।