SOAP Authentication Wrapper Code Samples for Java: Response-Only
  • 10 Dec 2024
  • 1 Minute à lire
  • Sombre
    Lumière
  • PDF

SOAP Authentication Wrapper Code Samples for Java: Response-Only

  • Sombre
    Lumière
  • PDF

The content is currently unavailable in French. You are viewing the default English version.
Résumé de l’article

The following code sample shows what you need to include in your webpage if you want to incorporate OneSpan Authentication Server Response-Only authentication.

<%@ page import="com.vasco.identikey.model.Credentials" %>
<%@ page import="com.vasco.identikey.controller.authentication.AuthenticationCommandResponse" %>

<jsp:useBean id="authenticationBean" class="com.vasco.identikey.controller.authentication.AuthenticationBean" scope="page" />

<%
    // Credentials have been provided, now perform the request
    String userID = request.getParameter("CREDFLD_USERID");
    String domain = request.getParameter("CREDFLD_DOMAIN");
    String pin = request.getParameter("CREDFLD_CURRENT_PIN");
    String dpResponse = request.getParameter("CREDFLD_DP_RESPONSE");
    String password = request.getParameter("CREDFLD_STATIC_PASSWORD");
    Boolean rhc = Boolean.valueOf("on".equals(request.getParameter("CREDFLD_REQUEST_HOST_CODE")));
    Credentials.RequestHostCode reqHostCode = rhc ? Credentials.RequestHostCode.Required : Credentials.RequestHostCode.Optional;

    // Execute the command
    AuthenticationCommandResponse results = authenticationBean.authUser(domain, userID, pin, dpResponse, password, reqHostCode);

    if (results.getReturnCode() == 0) {
%>
        <p>OTP Verification Succeeded</p>
<%
    }
%>

If you want to include other functionality, go to the sdk_install_dir/Java/src/SampleSite/src/main/webapp/jsp/authentication folder and use the code from the files in there. All the file names identify the function of the code in the file.


Cet article vous a-t-il été utile ?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Ozzy, facilitant la découverte de connaissances grâce à l’intelligence conversationnelle