How to Use the External Web Authentication Provider

Top  Previous  Next

Make an Ajax call to the z/Scope Anywhere external authentication handler to validate the external credentials. For example:

 

<script type="text/javascript">

   function authenticateUser(serverurl, params, callback) {

       if (!serverurl)serverurl = "";

       if (serverurl.lastIndexOf("/") == serverurl.length - 1)

           serverurl = serverurl.substring(0, serverurl.length - 1);

       var cd = serverurl != "";

       var dt = serverurl == ""? "html" : "jsonp";

       $.ajax({

           url: serverurl + "/authprov/?" + params,

           crossDomain: cd,

           dataType: dt,

           statusCode: {

               200: function (data) {

                   var url = cd? data.url : data;

                   if (url.indexOf("://") > 0) serverurl = "";

                   if (callback) {

                       callback(serverurl + url);

                   }

                   else {

                       location.href = serverurl + url;

                   }

               }

           }

       });

   }

 

   function sendRequest(params) {

       authenticateUser("http://zscope.anywhere.server:8023",

       params,

       function(url) {

           location.href = url;

       });

   }

</script>

 

Use the sendRequest function with parameters specific to your authentication page so it can identify the user and return the appropriate values to z/Scope Anywhere.

You can, for instance, call the sendRequest function with your website’s session identifier. As in this example: sendRequest("mySessionID=12345678&myUserID=JDoe")

 

z/Scope Anywhere will forward these parameters to the validation URL and will return a new location URL.

 

Read More:

Enabling z/Scope Anywhere ADS authentication
Enabling and Configuring the External Web Authentication Provider
How to Integrate your Custom Web Authentication Provider