» npm install expo-auth-session
Videos
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
What happened to seamless auth integrations with expo apps?
I'm using the expo-router and supabase. I want to implement google auth and I have two options:
expo-auth-session : the docs are not up to date, for implementing google auth with supabase the docs refer to the supabase docs which uses react-native-google-signin.
react-native-google-signin : the free/original version will be deprecated in 2025 so there's no point of using this and I do not want to use their paid version.
What should I do?