Jump to content

Automatic single sign on with Open Id Connect from whmcs to an external service


Recommended Posts

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated