Try this:
-Login to your expo account: on command line type:
expo login
##then your account credencials##
then restart your expo instance:
expo start
And everything should work fine
Answer from paichato on Stack OverflowVideos
» npm install expo-auth-session
Try this:
-Login to your expo account: on command line type:
expo login
##then your account credencials##
then restart your expo instance:
expo start
And everything should work fine
I have the exact same issue. I've posted on the Expo forums too and tried to contact the devs about it but nobody's responding to me. I think it's been broken with a recent change. If you look at the redirect URL it's supposed to have two more query parameters one for the authentication URL and one for the return URL
I’m working on integrating Google Calendar OAuth into my React Native app using Expo, and I’m running into an issue where the redirect URI returned by makeRedirectUri({ useProxy: true }) is wrong — it’s always exp://127.0.0.1:8081, even though I’m expecting the Expo proxy URI (e.g. https://auth.expo.io/@username/myapp) to be returned.
I’ve been debugging this for hours and would really appreciate any advice or insight.
Some Context:
I’m using expo-auth-session version ~5.5.2 My app is built with Expo Router and uses OAuth to Google Calendar I want to allow users to connect their Google Calendar and add events from our app I’m using web-based OAuth, not direct sign-in or server-side flows Running locally via expo & Android studio
This is my code snippet:
import { makeRedirectUri, useAuthRequest, ResponseType } from 'expo-auth-session'; import * as WebBrowser from 'expo-web-browser'; import { useEffect } from 'react'; import config from '@/config';
WebBrowser.maybeCompleteAuthSession();
const discovery = { authorizationEndpoint: 'https://accounts.google.com/o/oauth2/v2/auth', tokenEndpoint: 'https://oauth2.googleapis.com/token', };
export function useGoogleAuth() { const redirectUri = makeRedirectUri({ useProxy: true, scheme: 'my app name', });
console.log('[useGoogleAuth] redirectUri =', redirectUri);
const [request, response, promptAsync] = useAuthRequest( { clientId: config.googleClientId, scopes: ['https://www.googleapis.com/auth/calendar.events'], redirectUri, responseType: ResponseType.Code, extraParams: { access_type: 'offline', prompt: 'consent', }, }, discovery );
useEffect(() => { console.log('[useGoogleAuth] response =', response); }, [response]);
return { promptAsync, request, response }; }
And yes I added authorized uris and authorized test users in Google cloud console.
I also added the redirect URI: https://auth.expo.io/@myusername/myapp to google.
My questions: • Why is makeRedirectUri({ useProxy: true }) still giving me exp://127.0.0.1:8081? • Is there some config I’m missing in app.json, expo-router, or somewhere else? • Should I upgrade expo-auth-session or use a different method to get the correct proxy URI?
Thanks
I had the same configuration as yours, a little bit different is in the
scheme value in app.json.
So this issue is regarding the deep linking mechanism that currently has no longer supported due to the risk of app impersonation.
To solve this what you need is enable scheme manually in your OAUTH credentials.
- Go to credentials page
- Select your current OAUTH credentials
- Open Advanced setting
- Check Enable custom URI scheme Enable scheme
For more details you can check reference here: https://developers.google.com/identity/protocols/oauth2/native-app#redirect-uri_custom-scheme
could it be that you are logging in , on expo go, through a web browser as opposed to your app? and that google chrome or other trusted browsers are not installed in google play on your expo go? I tried installing google chrome first on my expo go then ran my app and it worked ok
Hello,
I hope someone can help with this expo issue.
I am trying to use the expo-auth-session to implement SSO with Facebook and getting the following message. Looking at the URL, it seems like it's able to retrieve the access_token from Facebook but something is throwing it off...
I saw a couple of articles on this error and they suggest to use the proxy parameter. But this field was obsolete and removed from the version i am using...
anybody has any idea what's going on??