- 06 Dec 2024
- 1 Minute à lire
- SombreLumière
- PDF
SOAP Signature Wrappers
- Mis à jour le 06 Dec 2024
- 1 Minute à lire
- SombreLumière
- PDF
The SOAP signature wrapper maps all commands defined in the OneSpan Authentication Server signature WSDL file in a class called SignatureHandler.
For the signature object, the IdentikeyResponse class is extended to a SignatureResponse class. For a list of different methods defined by this class, see Overview of SOAP wrappers.
Object model
In order to comply with the object-oriented aspect of the used programming language, the OneSpan Authentication Server Administration entity is wrapped by an object model. This object is essentially a container for the entities’ properties, since it has no logic.
These properties can be accessed using a specialized getter, e.g. getUserID(). To set these properties, use a specialized setter, e.g. setUserID(String userID).
SOAP signature wrapper code samples for .NET: Standard signature
The following code sample shows what you need to include in your webpage if you want to incorporate OneSpan Authentication Server signature functionality.
If you want to include other functionality, go to the sdk_install_dir/ASP.Net/src/SampleSite/authentication folder and use the code from the files in there. All the file names identify the function of the code in the file.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="signature.aspx.cs" Inherits="IdentikeySampleSite.authGroup.signature" %>
<asp:Content ID="Signature" ContentPlaceHolderID="MainContentHolder" runat="server">
<%
string userID = Request["SIGNFLD_USERID"];
string domain = Request["SIGNFLD_DOMAIN"];
string signature = Request["SIGNFLD_SIGNATURE"];
string[] fields = new string[8];
fields[0] = Request["SIGNFLD_DATA_FIELD_1"];
fields[1] = Request["SIGNFLD_DATA_FIELD_2"];
fields[2] = Request["SIGNFLD_DATA_FIELD_3"];
fields[3] = Request["SIGNFLD_DATA_FIELD_4"];
fields[4] = Request["SIGNFLD_DATA_FIELD_5"];
fields[5] = Request["SIGNFLD_DATA_FIELD_6"];
fields[6] = Request["SIGNFLD_DATA_FIELD_7"];
fields[7] = Request["SIGNFLD_DATA_FIELD_8"];
bool rcc = (bool)"on".Equals(Request["SIGNFLD_REQUEST_CONFIRM_CODE"]);
string deferredTime = Request["SIGNFLD_DEFERRED_DATETIME"];
string deferredEvent = Request["SIGNFLD_DEFERRED_EVENT_VALUE"];
// Execute the command
results = executeSignature(domain, userID, signature, fields, deferredTime, deferredEvent, rcc);
if (results.getReturnCode() == 0)
{
%>
<p>Signature verification succeeded</p>
<%
}
%>
</asp:Content>
This code comes from the signature.asp.cx file.
using IdentikeyWrapper.vasco.identikey.model;
using IdentikeyWrapper.vasco.identikey.signature;
namespace IdentikeySampleSite.authGroup
{
public partial class signature : System.Web.UI.Page
{
protected SignatureCommandResponse results;
protected SignatureCommandResponse executeSignature(string domain, string userID, string signature, string[] fields, string deferredTime, string deferredEvent, bool reqConfCode)
{
SignatureHandler handler = new SignatureHandler();
List<string> datafields = new List<string>();
foreach (string s in fields)
datafields.Add(s);
DateTime? dt = null;
try
{
string[] format = { "dd/MM/yyyy HH:mm:ss" };
dt = DateTime.ParseExact(deferredTime, format, null, DateTimeStyles.None);
}
catch (Exception) { }
uint? de = null;
try
{
de = Convert.ToUInt32(deferredEvent);
}
catch (Exception) { }
Signature.RequestConfirmationCode rcc = reqConfCode ? Signature.RequestConfirmationCode.Required : Signature.RequestConfirmationCode.Optional;
return handler.authSignature(domain, userID, signature, datafields, dt, de, rcc);
}
}
}