Enabling SSO with WooCommerce and any 3rd party

Viewed 226

I have a website w/ subscriptions that I've built with WP and WooCommerce. Customers can purchase subscriptions and then download the product once the purchase is complete. So far so good, however I would like to be able to offer a login in the product (a win/mac c++ standalone application) and allow the customer to login using the credentials they have entered while purchasing the product.

There's a few issues blocking this:

  1. WooCommerce does not expose an API to authenticate customers
  2. WooCommerce GET/customer does not return the password of the customer (this makes sense, but would have been useful for duplicating it in another db that I DO have access to via the product)
  3. There are no integrations with any SSO providers such as aws cognito, firebase, etc.

SO with this in mind: How can I authenticate a customer in a standalone product using their woocommerce customer credentials? I've spent hours trying to find a solution and am stumped!

EDIT: Apologies I think I'm using confusing language: I'm looking to authenticate a customer on a separate platform using the credentials they created when they created an account on the subscription platform in WooCommerce.

The flow is:

  1. Customer goes on the website (woo), purchases a subscription and creates an account
  2. Customer downloads the product, installs, and opens it
  3. The product has a login screen that asks for email/password - this should validate the credentials they have entered when purchasing the subscription on the website
1 Answers
<?php
require __DIR__ . '/vendor/autoload.php';

use Automattic\WooCommerce\Client;

$woocommerce = new Client(
    'https://example.com',
    'consumer_key',
    'consumer_secret',
    [
        'wp_api' => true,
        'version' => 'wc/v3'
    ]
);
?>

Authenticate using REST API

Related