Ecommerce Shopify WordPress Discussion

CodeIgniter -> Shopify API. How to log in via OAuth via the CLI? Using shopify-api-php

I have been racking my brain for ages here - if somebody could enlighten me I would be extremely grateful. I'm trying to perform a standard OAUTH login, exactly as per the docs here: I have the api key, api secret key, host name etc. I am invoking the action using the command line - there is no web interface. I am running the application locally and using Session storage as there are no web cookies as I am not using a web browser. Where I'm tripping up is on the 'callback' function - this doesn't seem to do anything. I am calling Context::initialize and OAuth::begin(... without issue but that is where things trip up. I have a corresponding route set up '/auth/callback' which I believe should be invoked once the server returns a response to the initial login request which then provides the code, hmac values etc. needed to validate the session, but nothing happens. I need to call OAuth::callback(... from within this callback function. Context::initialize( apiKey: config('ShopifyConfig')->api_key, apiSecretKey: config('ShopifyConfig')->api_secret_key, scopes: config('ShopifyConfig')->api_scopes, hostName: config('ShopifyConfig')->host_name, sessionStorage: new FileSessionStorage(), apiVersion: config('ShopifyConfig')->api_version, ); $redirectUrl = OAuth::begin( shop: config('ShopifyConfig')->host_name, redirectPath: '/auth/callback', // doesn't do anything! isOnline: false, setCookieFunction: function (OAuthCookie $cookie) { $_SESSION['cookie'][] = [ 'name' => $cookie->getName(), 'value' => $cookie->getValue(), 'expire' => $cookie->getExpire(), 'secure' => $cookie->isSecure(), 'httpOnly' => $cookie->isHttpOnly(), ]; return true; } ); public function logIn(Request $request) { OAuth::callback(...) // Routes file $routes->get('/auth/callback', 'Home::logIn'); $routes->post('/auth/callback', 'Home::logIn'); $routes->cli('/auth/callback', 'Home::logIn');
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.