Using ADUCID web service “WSA”


For detailed methods / classes / types description see Javadoc SDK Client API

WSA is meant for all platforms like PHP, C# except Java (Java is also possible but we provide a full module so WSDL import is redundant).

Web service is a standalone “application” which must be deployed on same server as AIM. Its default address is like this:


There you will see WSA Interface homepage where you can download WSDL file to generate client.


C# Example

Import WSDL into your project in Visual Studio.

Create an instance of AducidApiJsonServiceClient.

Create a start operation Url

This page starts authentication request.

var aducid = new AducidApiJsonServiceClient();
string host = "http://" + HttpContext.Current.Request.Url.Host + ":" + HttpContext.Current.Request.Url.Port;
string query = context.Request.QueryString.ToString();
var queryParsed = HttpUtility.ParseQueryString(query);
var generateQr = queryParsed["generateQrCodePicture"];
var arg = new OperationArgument();
//return URL for iOS
arg.peigReturnName = host + "/result";
//QR code picture size
arg.qrCodePictureHeight = 300;
arg.qrCodePictureWidth = 300;
//tab helper If - if more authentication are in web browser in more tabs this help ti identify them - has to be unique = "123";
arg.generateQrCodePicture = generateQr == "true";

//JSON response from WSA
var response = aducid.startAuthenticationSession(JsonConvert.SerializeObject(arg));
//parse and store authId
dynamic responseObj = JsonConvert.DeserializeObject(response);
//store authId in your session
context.Session["123"] = (string);
context.Response.ContentType = "text/plain";
//send response

OperationArgument is a simple object

public class OperationArgument
        public String peigReturnName { get; set; }
        public int qrCodePictureHeight { get; set; }
        public int qrCodePictureWidth { get; set; }
        public String id { get; set; }
        public Boolean generateQrCodePicture { get; set; }

Create WSA proxy

Just simple “Rewrite” from WSA to C# with authId check

var aducid = new AducidApiJsonServiceClient();
string host = "http://" + HttpContext.Current.Request.Url.Host + ":" + HttpContext.Current.Request.Url.Port;
var response = aducid.getStatus((string)context.Session["123"]);
context.Response.ContentType = "text/plain";

Create check Url

On the result page we evaluate the authentication There are two basic results – authentication is OK or an error is thrown:

var aducid = new AducidApiJsonServiceClient();
//read authId from you session
string authId = (string)context.Session["123"];
var aducidResult = aducid.getResult(authId, null);
//parse json
dynamic aducidResultObj = JsonConvert.DeserializeObject(aducidResult);
//User primary key i.e. UDI
var udi =;
//key to further ADUCID operetions on user object (with authId)
string authKey2 =;
//prepare response
var response = aducid.endAuthenticationSession(authId, authKey2);
context.Response.ContentType = "text/plain";
//OK do something with your session
//send response

Prepare a web page

This page should contain ADUCID Integration API
Provide start, check and proxy Url.

Override what should be done after authentication / operation:
   aducid.processResult = function (result) {
                if (result.status == "OK") {
                else {
                    alert("atuhentication failure");

And create some HTML elements:

<h1>ADUCID Hello World example</h1>
        <div class="row">
            <div class="col-xs-8 col-xs-offset-2">

                <div class="row">
                    <div class="col-xs-8 col-xs-offset-2">
                        <div id="main-button" class="btn btn-primary btn-lg center-block">Authenticate</div>
                <div class="row">
                    <img id="qr-code" alt="" class="img-responsive center-block" />

                <div class="row text-center">
                    <div id="qr-code-timer" class="qr-code-timer img-responsive center-block"></div>
                    <div id="qr-code-hint" class="qr-code-hint"></div>

                <div id="peig-error" style="display: none;">
                    <h2>PEIG Error</h2>
                    <a class='btn  btn-lg' href='' data-lang="aducid_common_installPeig">Install PEIG</a>
                    <br />
                    <div class='btn btn-lg' onclick="location.reload()" data-lang="aducid_common_tryAgain">Try again</div>

  • developers/integration/wsa.txt
  • Last modified: 2018/11/12 13:02
  • by mpospisek