pRieStaKos Posted February 11, 2022 Share Posted February 11, 2022 (edited) Hello, I'm integrating a platform with our WHMCS and they require SSO integration via OAuth2 3-Legged Flow. The platform requests services and each service requests a SSO connection with WHMCS, by providing an Entry URL, a Logout URL and OAuth configuration (Logout/Redirect URL) and generates Client ID and Secret. From their documentation I got Authorization URL, Token URL, Logout/End Session URL, Client ID, Client Secret (from product settings). From what I see I need to serve their platform as the Identity Provider and WHMCS as the Client that gives access to WHMCS for each platform client. On our custom module for this integration, implemented league/oauth-client (I am on v7.10) and created files as this guide suggests to. I tried using their configuration by triggering their Authorization URL, but I get the approve page and connection is not established. It's probably wrong as it needs to be the other way. I created OpenID credentials from WHMCS and trigger WHMCS Authorization URL along with the other options and by providing /clientarea.php or module/addonname/oauth2/authorize.php as Redirect URL. When I try to trigger the connection from the third-party platform, I'm getting a login page (for WHMCS) and when I provide the user credentials, I am redirecting to the clientarea.php with code/state values, but not connected. I tried /oauth/authorize.php from this guide and I'm redirecting to /oauth/clientarea.php with 404 error. Any suggestions to follow the correct approach on this ? I want to create the SSO/Oauth2 connection with the third-party platform and be able to connect as Client to WHMCS when a client clicks on the service's URL from the other platform. Thank you in advance. Edited February 11, 2022 by pRieStaKos 0 Quote Link to comment Share on other sites More sharing options...
yrmallu Posted June 12 Share Posted June 12 Hi, I am looking to implement Single Sign-On (SSO) in WHMCS with Auth0 serving as the Identity Provider (IdP) using OAuth 2.0 protocol. Can you please let me know how to achieve this? Thanks 0 Quote Link to comment Share on other sites More sharing options...
bear Posted June 12 Share Posted June 12 Seen this? https://docs.whmcs.com/system/authentication/openid-connect/ 0 Quote Link to comment Share on other sites More sharing options...
yrmallu Posted June 13 Share Posted June 13 @bear Thanks for your response. I have seen but it's not working as expected. When I install Auth0 PHP SDK it crashes the WHMCS app with following error. Quote [Wed Jun 12 19:39:30.707018 2024] [php:error] [pid 1358623] [client 192.168.80.237:56137] PHP Fatal error: Uncaught Error: Class "WHMCS\\Utility\\ErrorManagement" not found in /var/www/html/whmcs/init.php:0\nStack trace:\n#0 /var/www/html/whmcs/index.php(0): unknown()\n#1 {main}\n thrown in /var/www/html/whmcs/init.php on line 0 I have installed Auth0 PHP SDK on WHMCS root directory using composer as follows Quote composer require auth0/auth0-php If you have implemented SSO then can you please share some sample code how to implement this Thanks in advance. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.