[expo-auth-session] redirect URI doesn't work on iOS (spotify api)
See original GitHub issue🐛 Bug Report
Summary of Issue
I’m using expo-auth-session to connect to spotify, this works in the expo app but when I release to testflight, the redirect uri is not valid (illegal uri).
Reproducible Demo
I followed the spotify demo on the expo documentation site. The app names ‘com.company.app’ etc are correctly added in the developer panel of spotify.
My auth code looks like this:
const [request, response, promptAsync] = useAuthRequest(
{
clientId: "{id}",
scopes: [
"user-read-email",
"user-read-playback-state",
"user-modify-playback-state",
"playlist-modify-public",
],
// In order to follow the "Authorization Code Flow" to fetch token after authorizationEndpoint
// this must be set to false
usePKCE: false,
// For usage in managed apps using the proxy
redirectUri: makeRedirectUri({
// For usage in bare and standalone
native: Platform.select({
android: `be.{company}.{app}//redirect`,
ios: `be.{company}.{app}//redirect`,
}),
}),
},
discovery
);
Steps to Reproduce
use the code above, connect to spotify.
Expected Behavior vs Actual Behavior
In the expo app it will work, however, once you deploy to testflight or wherever. It will crash and return ‘illegal url’
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (1 by maintainers)
Top Results From Across the Web
AuthSession - Expo Documentation
Initiation: the user presses a sign in button; Open web browser: the app ... If the URL that the auth service is redirecting...
Read more >Couldn't get back in my app once i'm login in with spotify
Run expo start:web --https to run with https, auth won't work ... If the redirect URIs are not setup then Spotify won't know...
Read more >Trouble With Expo React-Native Spotify Authentication
Fix the Facebook login error “URL blocked: This redirect failed because the redirect URI is In this article, we show you how to...
Read more >Understanding Spotify OAuth for React Native/Expo Apps
Spotify's API is incredible, but it can be confusing to figure out ... If you're not using Expo, just choose a Redirect URI...
Read more >Spotify Authentication with React Native | by Kevin Tomas
When I first started this project, I faced the problem that there were not ... the authentication process with Spotify, ReactNative and expo-auth-session....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
so probably my issue was that I used com.domain.name//redirect instead of name//redirect. Should work now
We have this working in production. Only real difference is that we use: