Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Oauth2 redirect_uri_mismatch when send request from localhost

I use Google OAuth2 for my codeigniter application and i send request using the HybridIgniter.

REDIRECT URIS : http://localhost/college-rating-system/hauth/endpoint.

JAVASCRIPT ORIGINS : http://localhost

When send request from localhost then we get 400 error that is,

Error : redirect_uri_mismatch

Any idea ..?

like image 303
Mitul Koradiya Avatar asked Feb 10 '15 12:02

Mitul Koradiya


People also ask

What does Error 400 Redirect_uri_mismatch mean?

This error typically means the Client Redirect URL was not properly added to the OAuth Web Application in the Google Cloud Console. To resolve this, the user will need to copy the Client Redirect URL from the Single Sign-On Settings page from ThinkCentral, my.hrw.com, or HMH Ed.

What is Google OAuth redirect URI?

The redirect URIs are the endpoints to which the OAuth 2.0 server can send responses. These endpoints must adhere to Google's validation rules. For testing, you can specify URIs that refer to the local machine, such as http://localhost:8080 .

What should be the redirect URI in oauth2?

The redirect URL is the endpoint for your application or web page that processes the seller authorization response and manages the seller's OAuth tokens. You need to add this URL to your application using the Developer Dashboard.


2 Answers

Check the full error it will tell you the URL its coming from.

The redirect URI must match exactly what you have placed in the Google developer console.

like image 107
DaImTo Avatar answered Sep 29 '22 19:09

DaImTo


Redirect URIs

http://localhost:8000/ this / at end solve my problem JavaScript origins

http://localhost:8000

NOTE: localhost and 127.0.0.1 conflicts can create problems for you sometime

like image 27
Jose G Varanam Avatar answered Sep 29 '22 21:09

Jose G Varanam