We are using WHMCS as our billing and account management platform. We need a "login with WHMCS" implementation within one of our 3rd party apps.
Basically a user creates an account on WHMCS.
If the user is already logged into WHMCS, the user should be already logged in our 3rd party app on a subdomain.
If user is not logged in WHMCS but goes directly to the 3rd party app, a login with WHMCS button should appear that redirects the user to login in WHMCS.
After login user gets redirected to the 3rd party app.