Web API PKCE Authorize Not Working: INVALID_CLIENT: Invalid redirect URI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Plan
Premium
Country
USA
Device
Pixel 3a Emulator
Operating System
Android 13
My Question or Issue
I am developing a mobile app with flutter/dart that uses Spotify's Web API. I am able to authenticate users without PKCE but when I use PKCE I get the error "INVALID_CLIENT: Invalid redirect URI" yet I have not changed the redirect URI and the URI used in the request matches the URI in the settings in my developer portal. Do I need to do anything other than use the parameters code_challenge_method and code_challenege to use PKCE?
Here is an example of the authorization URl I use:
Query Parameters:
response_type: code
scope: user-top-read+user-read-recently-played
redirect_uri: com.example.abc-spotify%3A%2F%2F
code_challenge: 877811825597e44c2a3f38f2ea615370212d32a3837c1e98bec67f1b103be88b
This was the code verifier in this example: ueA7xfrl9hB8Q8jPBzvxHL0ldxzjPN5PWCGnG8pbtw7Gmlin9nyBXw2l4hFc6rDQflcUmAbbe72bURkY5QAfErDsKjDZ1x3P9glG
- Labels:
-
App authorization
-
flutter
-
PKCE
-
Spotify Web API
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page