User Tools

Site Tools


developers:integration:wsa

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
developers:integration:wsa [2018/06/27 14:27]
tjotov
developers:integration:wsa [2019/08/01 10:07]
tjotov removed
Line 4: Line 4:
   * [[developers:basic-overview|Server side integration basics]]   * [[developers:basic-overview|Server side integration basics]]
   * [[integration-api:start|ADUCID Integration API]]   * [[integration-api:start|ADUCID Integration API]]
-  * +
 For detailed methods / classes / types description see [[http://wiki.aducid.com/client-api|Javadoc SDK Client API]] For detailed methods / classes / types description see [[http://wiki.aducid.com/client-api|Javadoc SDK Client API]]
  
Line 31: Line 31:
 This page starts authentication request. This page starts authentication request.
  
-<code csharp>+<sxh csharp>
 var aducid = new AducidApiJsonServiceClient(); var aducid = new AducidApiJsonServiceClient();
 string host = "http://" + HttpContext.Current.Request.Url.Host + ":" + HttpContext.Current.Request.Url.Port; string host = "http://" + HttpContext.Current.Request.Url.Host + ":" + HttpContext.Current.Request.Url.Port;
Line 51: Line 51:
 //parse and store authId //parse and store authId
 dynamic responseObj = JsonConvert.DeserializeObject(response); dynamic responseObj = JsonConvert.DeserializeObject(response);
-//store authId to your session+//store authId in your session
 context.Session["123"] = (string) responseObj.data.authId; context.Session["123"] = (string) responseObj.data.authId;
 context.Response.ContentType = "text/plain"; context.Response.ContentType = "text/plain";
 //send response //send response
 context.Response.Write(response); context.Response.Write(response);
-</code>+</sxh>
  
 OperationArgument is a simple object OperationArgument is a simple object
-<code csharp>+<sxh csharp>
 public class OperationArgument public class OperationArgument
     {     {
Line 68: Line 68:
         public Boolean generateQrCodePicture { get; set; }         public Boolean generateQrCodePicture { get; set; }
     }     }
-</code>+</sxh>
 === Create WSA proxy === === Create WSA proxy ===
 Just simple "Rewrite" from WSA to C# with authId check Just simple "Rewrite" from WSA to C# with authId check
-<code csharp>+<sxh csharp>
 var aducid = new AducidApiJsonServiceClient(); var aducid = new AducidApiJsonServiceClient();
 string host = "http://" + HttpContext.Current.Request.Url.Host + ":" + HttpContext.Current.Request.Url.Port; string host = "http://" + HttpContext.Current.Request.Url.Host + ":" + HttpContext.Current.Request.Url.Port;
Line 77: Line 77:
 context.Response.ContentType = "text/plain"; context.Response.ContentType = "text/plain";
 context.Response.Write(response); context.Response.Write(response);
-</code>+</sxh>
  
 === Create check Url === === Create check Url ===
Line 83: Line 83:
 There are two basic results – authentication is OK or an error is thrown: There are two basic results – authentication is OK or an error is thrown:
  
-<code csharp>+<sxh csharp>
 var aducid = new AducidApiJsonServiceClient(); var aducid = new AducidApiJsonServiceClient();
 //read authId from you session //read authId from you session
Line 101: Line 101:
 //send response //send response
 context.Response.Write(response); context.Response.Write(response);
-</code>+</sxh>
  
  
 === Prepare a web page === === Prepare a web page ===
 This page should contain [[integration-api:start|ADUCID Integration API]]\\ This page should contain [[integration-api:start|ADUCID Integration API]]\\
-Provide start, check and proxy Url.  +Provide start, check and proxy Url. 
- aducid.setStartOperationUrl("myOpen"); +<sxh>  
- aducid.setResultOperationUrl("myPpenCheck"); +   aducid.setStartOperationUrl("open"); 
- aducid.setProxyUrl("myProxy");+   aducid.setResultOperationUrl("openCheck"); 
 +   aducid.setProxyUrl("proxy"); 
 +</sxh> 
 +Override what should be done after authentication / operation: 
 +<sxh>  
 +   aducid.processResult = function (result) { 
 +                if (result.status == "OK") { 
 +                    alert("atuhenticated"); 
 +                    //location.reload(); 
 +                } 
 +                else { 
 +                    alert("atuhentication failure"); 
 +                } 
 +            } 
 +</sxh>  
 + 
 +And create some HTML elements: 
 + 
 +<sxh html> 
 +<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> 
 +                </div> 
 +                <div class="row"> 
 +                    <img id="qr-code" alt="" class="img-responsive center-block" /> 
 +                </div> 
 + 
 +                <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>
  
 +                <div id="peig-error" style="display: none;">
 +                    <h2>PEIG Error</h2>
 +                    <a class='btn  btn-lg' href='http://www.aducid.com/support/' 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>
 +                </div>
 +            </div>
 +        </div>
 +</sxh>