The "shopify oauth error invalid_request the redirect_uri is missing" is one of the most common authentication issues developers encounter when building Shopify apps or integrating with the Shopify API. This error occurs during the OAuth 2.0 authorization flow when your application attempts to redirect users to Shopify's authorization endpoint, but the redirect URI parameter is either completely absent, incorrectly formatted, or doesn't match what's registered in your Shopify app settings.
In technical terms, the redirect_uri is a critical parameter in the OAuth 2.0 protocol that tells Shopify where to send the user after they've authorized your app. Without this parameter, Shopify cannot securely return the authorization code to your application, which means your app cannot complete the authentication handshake. This is a security feature designed to prevent malicious applications from intercepting authorization codes.
When Shopify receives your authorization request without a redirect_uri, it rejects the request with the "invalid_request" error code because the OAuth specification requires this parameter for the authorization code flow to work properly. Understanding this error is the first step toward resolving it quickly and implementing proper OAuth authentication in your Shopify applications.
Step 1: Verify Your Shopify App Settings
Log into your Shopify Partner Dashboard and navigate to your app settings. Under the "Configuration" or "App Setup" section, find the "Allowed redirect URIs" field. Note down exactly how your redirect URI is configured. It should be a complete URL including the protocol (https:// or http://), the domain, and any port numbers or paths. For example: "https://yourapp.com/auth/callback" or "http://localhost:3000/auth/shopify/callback".
Step 2: Check Your Authorization URL
Review your application code where you're constructing the authorization URL. Ensure that you're explicitly including the redirect_uri parameter in your request. The parameter must be properly formatted and URL-encoded. Here's what your code should look like:
// Node.js/Express example
const redirectUri = 'https://yourapp.com/auth/callback';
const authorizationUrl = `https://${shop}/admin/oauth/authorize?client_id=${clientId}&scope=${scopes}&redirect_uri=${encodeURIComponent(redirectUri)}`;
res.redirect(authorizationUrl);
Step 3: Ensure Exact URL Matching
The redirect_uri you send in your authorization request must match exactly with what you've registered in your Shopify app settings. This means:
Step 4: Implement Proper Error Handling
Add logging to your authorization flow so you can see exactly what URL is being sent to Shopify. This helps identify mismatches between your registered URI and what your code is actually sending:
// Express.js example with debugging
app.get('/auth', (req, res) => {
const shop = req.query.shop;
const clientId = process.env.SHOPIFY_CLIENT_ID;
const redirectUri = process.env.SHOPIFY_REDIRECT_URI;
const scopes = 'write_products,read_orders';
// Log the values for debugging
console.log('Shop:', shop);
console.log('Client ID:', clientId);
console.log('Redirect URI:', redirectUri);
console.log('Redirect URI (encoded):', encodeURIComponent(redirectUri));
const authUrl = `https://${shop}/admin/oauth/authorize?client_id=${clientId}&scope=${scopes}&redirect_uri=${encodeURIComponent(redirectUri)}`;
console.log('Full authorization URL:', authUrl);
res.redirect(authUrl);
});
Step 5: Handle the Callback
Create an endpoint that matches your redirect_uri to handle the authorization callback from Shopify. This endpoint receives the authorization code that you'll exchange for an access token:
// Callback endpoint
app.get('/auth/callback', async (req, res) => {
const { code, hmac, shop, state } = req.query;
if (!code || !shop) {
res.status(400).send('Missing required parameters');
return;
}
try {
// Exchange authorization code for access token
const response = await fetch(`https://${shop}/admin/oauth/access_token`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
client_id: process.env.SHOPIFY_CLIENT_ID,
client_secret: process.env.SHOPIFY_CLIENT_SECRET,
code: code,
redirect_uri: process.env.SHOPIFY_REDIRECT_URI
})
});
const data = await response.json();
const accessToken = data.access_token;
// Store accessToken securely for future API calls
res.send('Authorization successful!');
} catch (error) {
console.error('OAuth error:', error);
res.status(500).send('Authorization failed');
}
});
Step 6: Test with Localhost
When developing locally, register "http://localhost:3000/auth/callback" (or whatever port you're using) as a redirect URI in your Shopify app settings. Make sure your development server is running on exactly that port. If you need to test on a different machine or access your app from the internet, use a tunneling service like ngrok to expose your local server and register the ngrok URL as your redirect URI.
If you're in a hurry, here's the quickest path to resolution:
If you're still struggling with the OAuth flow after these steps, tools like getshopifytoken.com can automate this step and handle the token management for you, eliminating manual OAuth configuration errors. This is especially useful for rapid development and testing scenarios where you need to quickly obtain valid access tokens.

Yes, you can register multiple redirect URIs in your Shopify app settings. This is useful when you have different environments (development, staging, production) or need to support multiple callback endpoints. Just make sure the redirect_uri you send in your authorization request matches one of the registered URIs exactly. Each redirect_uri must be added separately in the app configuration.
For production Shopify apps, yes, your redirect_uri must use HTTPS. Shopify enforces this security requirement to prevent man-in-the-middle attacks. However, for localhost development (http://localhost:PORT), HTTP is permitted. If you're developing locally and need to test with HTTPS, you'll need to use a tunneling service like ngrok that provides HTTPS URLs for your local server.
The OAuth 2.0 specification uses "redirect_uri" (URI, not URL). While these terms are often used interchangeably in casual conversation, Shopify's API expects the exact parameter name "redirect_uri". Using "redirect_url" or any other variation will result in the invalid_request error because Shopify won't recognize the parameter you're sending.
Add comprehensive logging throughout your OAuth flow to capture the exact values being sent to Shopify. Log the shop name, client ID, scopes, and the complete authorization URL before redirecting. Check your server logs, browser developer tools (Network tab), and Shopify app logs for error messages. If Shopify rejects the request, it will include error details that can point you toward the specific problem with your redirect_uri or other parameters.