Hello,
I am implementing a provisioning module. I have added a "Login to My Service " button in the product details page and this is the desired flow:
* Client clicks on "Login to My Service " button.
* Whmcs calls to my own dedicated server (where My Service is hosted).
* My server calls to Whmcs to verify that the customer with the given email is the one making the request.
* The customer is automatically logged into My Service without setting specific credentials.
Reading the documentation related to Open Id Connect I have tested the following:
* Client clicks on "Login to My Service " button.
* Whmcs calls to my own dedicated server (where My Service is hosted).
* My server calls to /oauth/openid-configuration.php to discover /oauth/authorize.php endpoint.
* My server makes a POST to /oauth/authorize.php. And here is the question. There is no way to set an specific email in the parameters, so the result is that the response includes the html representing the whmcs login view. But that forces me to render that login view in My Service, and forces the customer to login into Whmcs again.
That is not what I am expecting. As the customer is already logged into Whmcs, I wonder if there is a way to directly obtain the code (the final result of calling to /authorize.php) in Whmcs for the current customer (just for authentication purposes, not authorization given). The code would be sent to my server in order to validate it and obtain the id token (and finally creating a session for the customer). I have checked articles related to Open Id Connect and I have checked the LocalApi too looking for a way to directly show the login view in Whmcs) but I haven't found a way to achieve this.
Has someone tried to implement this? Any advice or clarification?
Thanks in advance.