Topic-icon Can we modify SCLogin code for simultaneous login to Tableau Online?

Active Subscriptions:

None
The goal we seek is to allow our website (registered) users to use the SCLogin module for both logging into our site, and also logging into their Tableau Online user seat. (the user will already have an established Tableau Online account, fyi). When the user logs into our site via SCLogin, they are simultaneously logged in to their Tableau account, too. We will likely not enable self registration by the user, as we will create their Joomla login credentials to be same as their existing Tableau login credentials. We would want to ensure the user logs out of Tableau upon logging out of Joomla, too.

Q?: Could the existing SCLogin code be customized to accomplish this?
Q?: ...or, would this need to be a separate customized login module apart from SC Login?
Q?: ...or, is there a better alternative method to accomplish the process we seek?

Here is the start of our coding efforts, fyi. So far, we've not been able to successfully do the tunneling required for simultaneous logins. Our initial thought is we need to create a certain encrypted key using the public key from Tableau and a private key along with the modulus and exponent from Tableau.
Thanks in advance!


<?php
//$filename = 'Math/BigInteger.php';
//if (file_exists($filename)) {
//echo "The file $filename exists";
//} else {
//echo "The file $filename does not exist";
//}
echo '<br/>';
echo '<br/>';


include('Crypt/RSA.php');
include('Math/BigInteger.php');

//$url = 'online.tableausoftware.com/auth.xml';
//$xml = simplexml_load_file($url);

// get modulus, exponent and auth_token
//$modulus=$xml->modulus;
//$exponent=$xml->exponent;
//$auth_token=$xml->authenticity_token;

$modulus='8224328b0b5df7af2debf17307a013fb9296aab6b5bede535d4636c356a5055afac89934a96f326b220b0374c6c22ce795ad18d3ebfbc6981175cb38166374c37348ea2c312198f3805e0ed5a08990ee9ec235344c3e2d7d492494efb12136c8d6430a69ab3e1f33d08f7443d5161ffdfda8252ba87f937514d7cab10fe7bb2b';
$exponent='10001';
$auth_token='iXppBk8KtzbG7A4JQL0QJAWz5n5+JRbgNrzCpMeVGGI=';

echo $modulus;
echo '<br/>';
echo $exponent;
echo '<br/>';
echo $auth_token;
echo '<br/>';

$rsa = new Crypt_RSA();
$rsa->loadKey(
array(
'e' => new Math_BigInteger($exponent, 16),
'n' => new Math_BigInteger($modulus, 16)
)
);
$rsa->setEncryptionMode(CRYPT_RSA_ENCRYPTION_PKCS1);
echo 'ENCRYPTED ';
echo $rsa->encrypt('1234567890');
echo 'DONE';
echo '</br>';

?>
The topic has been locked.
Support Specialist
First, I don't know anything about Tableau or how authentication works. With that said, I probably can't give the 'best' answer, but I can help get you started or give you a few things to investigate further.

SCLogin
Most importantly, the SCLogin module doesn't really do any authentication. We either pass the user credentials off to Joomla to log the user in or we hand them off to JFBConnect to log them in with a social network.

Joomla plugins
If you're planning to force the user to login to Joomla first *and then* use those credentials (or some sort of stored/generated token) to log them into Tableau, the proper place to do that would be in a Joomla User plugin. The User plugins have a "onUserLogin" function which can get information about the user that just logged in and 'do' whatever you want, like authenticating them to Tableau as well. Additionally, there's an onUserLogout function which could log them out of Tableau as well.

JFBConnect authentication
If you want users to be able to authenticate using their Tableau credentials (and/or automatically create an account on your Joomla site if they don't have one), you may be able to do that, depending on what Tableau supports. JFBConnect has built-in classes for Oauth1 and Oauth2 authentication, which would make it easier (though not necessarily simple) to authenticate a user from Tableau on your site.

I hope that helps give you some ideas of where to put your code. From your description, the Joomla User plugin definitely sounds like where you should be starting from.

I hope that helps, but should you need anything else, just let me know.

Thanks,
Alex
The topic has been locked.