Comments (9)
i am facing the same issue. even if i enter a redirect_uri
, when using responseType='code', it is not being read and a default redirect_uri with storagerelay://xxxx
is being used.
after which, when i use the auth code generated, i will get a redirect_uri_mismatch
error, probably because storagerelay://xxxx
is not a valid redirect_uri and it cannot be added to the google console.
how can we resolve this?
from react-google-login.
We figured it out. On the server, you must set the redirect_uri="postmessage" . This does break codes from mobile clients, so we needed to make it dynamic by client, but for this library, and our params, this fixes it and we're able successfully validate codes.
OAuth2.Client.new([
strategy: __MODULE__,
client_id: ...,
client_secret: ...,
redirect_uri: "postmessage",
site: "https://accounts.google.com",
authorize_url: "/o/oauth2/auth",
token_url: "/o/oauth2/token"
])
More info here: https://stackoverflow.com/questions/11485271/google-oauth-2-authorization-error-redirect-uri-mismatch
from react-google-login.
Can you please post the version of the component you are using along with including your prop values.
from react-google-login.
I am using react-google-login version
: 2.8.9
<ReactGoogleSignIn
className='btn btn-primary'
offline
clientId='CLIENT_ID.apps.googleusercontent.com'
scope='https://www.googleapis.com/auth/adsense.readonly'
redirectUri='http://localhost:8086/auth2redirect'
responseType='code'
buttonText='Grant Access'
onSuccess={responseGoogle}
onFailure={responseGoogle}
/>
The url fired is
https://accounts.google.com/o/oauth2/auth?redirect_uri=storagerelay%3A%2F%2Fhttp%2Flocalhost%3A8086%3Fid%3Dauth191356&response_type=code+permission+id_token&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadsense.readonly+openid+profile+email&openid.realm&client_id=13467883700-qp1vrapq1d6767ahigjrc17spfskud4b.apps.googleusercontent.com&ss_domain=http%3A%2F%2Flocalhost%3A8086&access_type=offline&include_granted_scopes=true&origin=http%3A%2F%2Flocalhost%3A8086&gsiwebsdk=2&from_login=1&as=4c5ff16c7294d433&pli=1&authuser=0
Observations:
- I am not passing
redirectUri
, still i seeredirect_uri=storagerelay%3A%2F%2Fhttp%2Flocalhost%3A8086%3Fid%3Dauth191356
- Passed value for
scope
ishttps://www.googleapis.com/auth/adsense.readonly
but in the URLscope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadsense.readonly+openid+profile+email
- for
responceType=code
, url hasresponse_type=code+permission+id_token
(I think I might be missing something here or using the wrong props)
from react-google-login.
I have similar problems as @imtmh has.
<GoogleLogin clientId="CLIENT_ID.apps.googleusercontent.com" buttonText="Login" responseType="code" offline="true" scope="email profile https://www.googleapis.com/auth/youtube" onSuccess={responseGoogle} onFailure={responseGoogle} />
In the url requested https://accounts.google.com/o/oauth2/auth
i have following params:
redirect_uri:storagerelay://http/localhost:7770?id=auth589157
;response_type:code permission id_token
(i need only code);scope:email profile https://www.googleapis.com/auth/youtube openid
(i don't need openid);
Are there any updates regarding this problem? I am also using react-google-login version: 2.8.9
from react-google-login.
@Makiss @imtmh a default redirect_uri
seems to get added by Google, I wouldn't worry about it too much unless there's an issue I'm missing.
openid
, profile
and email
scopes also get set as a default, but those can be disabled by explicitly setting fetch_basic_profile
to false
. This lib currently has a bug when setting fetchBasicProfile={false}
but I've submitted a PR describing the issue which hopefully gets merged soon enough :)
from react-google-login.
Closing due to inactivity.
from react-google-login.
@anthonyjgrove I am also facing the same issue. How to fire custom redirect_uri?
@imtmh Did u get any solution around this?
from react-google-login.
Anyone figure this out or move to another library?
from react-google-login.
Related Issues (20)
- SignIn is deprecated for new client application HOT 9
- This document requires 'TrustedScript' assignment. HOT 1
- React 18 HOT 14
- Is the "sub" identifier permanent for particular google account? HOT 2
- The login button is disabled everytime while implementing on next.js. But works fine in terms of react.js. Does this package have support for next? HOT 1
- could not peer react@"^16 || ^17" from [email protected] HOT 12
- popup_closed_by_user HOT 13
- Missing required parameter HOT 4
- Google deprecation-warning HOT 3
- include_granted_scopes default set to true
- Not compatible with React 18 HOT 1
- Not able to filter emails HOT 3
- Still maintained? HOT 2
- 403: Request had insufficient authentication scopes.
- Error "popup_closed_by_user" HOT 3
- OnFailure Method is silently called when page loads and when successfully logged in to Google. HOT 1
- user authentication or authorization deprecation issue HOT 2
- login button is disabled in Production HOT 5
- Migrate to Google Identity Services from Google Sign-In JavaScript library HOT 1
- Please Archive this repo !
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-google-login.