1 Reply Latest reply on Jan 5, 2017 10:24 AM by Ricardo Gonzalez

    asl.auth not working

    Ricardo Gonzalez

      I've been trying to authenticate a user as documented on SB1 Programmer’s Guide with no luck.

       

      Currently have the following environment:

      OS 03.01.45

      RhoElements 5.8.2.0

      Engine 2.3.0.0

      AppFolder 45.01

      SB1Shell 3.9.0

       

      This is the code I'm currently using:

      asl.auth(true, { name: 'TheUserName', title: 'TheUserTitle', badge: 'http://127.0.0.1:83/UserDrive/apps/UserViews/Badge.html' });

       

      on a client side event on HTML page, executed by a button element in the following way:

      javascript (inside head):

       

      <script type="text/javascript" src="asl.js"></script>

      <script type="text/javascript">

      function login()

              {

                      asl.auth(true, { name: 'John', title: 'Lennon', badge: 'http://127.0.0.1:83/UserDrive/apps/UserViews/Badge.html' });

              }

      function logOut()

              {

                  //Neither profile(null) nor signOut works also

                  //asl.profile(null);

                  //asl.signOut();  //Hacer SignOut del SmartBadge

                  if (asl.prv.user == null)

                      _alert('New User: null');

                  else

                      _alert('New User:' + asl.prv.user.name); //this works perfectly, shows current profile user

              }

      </script>

       

      html:

      <button onclick="login()" title="Login">Login</button>

      <button onclick="logOut()" title="LogOut">Logout</button>

       

      Currently it stops working (kindof) it freezes asking to continue waiting for the application when either call asl.auth or asl.profile(null) or asl.signOut(), none of them works on SmartBadge.

       

      Note: asl.profile works as well as asl.prv.user.name when used together, but what we need is to both sign in and sign out from SB1.

       

      Thanks in advance for your help.

      Ricardo