Abernee Posted January 21, 2021 Share Posted January 21, 2021 (edited) Since upgrading to 8.1 from 7.10 I'm having to update my web application to use WHMCSs single sign on API to allow my users to navigate and sign in to the WHMCS client area direct from my own website. Previously I was using the old autoAuth method with no issues. In the new single sign on API call, setting the 'destination' parameter to 'clientarea:submit_ticket' or 'clientarea:tickets' works as expected and the user gets linked to the desired page. On 7.10 with the old autoAuth I could create a link direct to the WHMCS cart where the user would be logged in and the selected product added to the cart by adding "&goto=" & UrlEncode("cart.php?a=add&pid=2")" to the link. Now with the single sign on I can't see how to do this. I've tried setting the 'destination' parameter to 'sso:custom_redirect' and the 'sso_redirect_path' to 'cart.php?a=add&pid=2' but the provided link always goes to the WHMCS news page. If anyone could help me get this working again that would be great as it is fairly important for my application. Edited January 21, 2021 by Abernee 0 Quote Link to comment Share on other sites More sharing options...
Abernee Posted January 21, 2021 Author Share Posted January 21, 2021 I'm really sorry, this thread can be deleted. After struggling with this for days I see that I had an error in how I was adding the parameters to the WHMCS API call. Doing it as per the documentation worked just fine. 0 Quote Link to comment Share on other sites More sharing options...
SMC Posted July 8, 2021 Share Posted July 8, 2021 Hello I am facing the same issue. Would you please let me know what your mistake was for the parameter? i am passing destination: 'sso:custom_redirect' and sso_redirect_path:'viewinvoice path'. it's going every time on a new page. As you said i also have followed document properly but not working 0 Quote Link to comment Share on other sites More sharing options...
Achhar Singh Posted December 8, 2022 Share Posted December 8, 2022 Hello, $command = 'CreateSsoToken'; $postData = array( 'client_id' => '8', 'destination' => "sso:custom_redirect", 'sso_redirect_path' => "clientarea.php?action=invoices" ); $results = localAPI($command, $postData); Relative path should be given in 'sso_redirect_path' when using 'destination' => "sso:custom_redirect", instead of full or any formatted path. Thanks 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.