Informazioni commerciali +39 0575 05077
  Assistenza telefonica +39 0575 0508
 
Common > Verificare lo stato del sistema di autenticazione forte

    1.7 Verificare lo stato del sistema di autenticazione forte

    Tramite il metodo IWSCommon GetUserOtp è possibile verificare la presenza dell'utente nel sistema di autenticazione forte.

    /// IWsCommon.GetUserOtp  Method (c# .NET)
    public static string GetUserOtp(WsCommonClient client)
    {
        //specify the account login details 
        client.ClientCredentials.UserName.UserName = "ARU-0000";
        client.ClientCredentials.UserName.Password = "0123456789";
    
        StringBuilder stringBuilder = new StringBuilder();
    
        try
        {
            // call method GetUserOtp 
            // obtaining a WsResultOfUserDataOtp item
            WsResultOfUserDataOtp result = client.GetUserOtp();
    
            // if the call is Success print returned values
            if (result.Success)
            {
                stringBuilder.Append("Operation ends successfully\n");
    
                // get Value returned from server
                UserDataOtp item = result.Value;
    
                if (item != null)
                {
                    stringBuilder.Append("UserDataOtp detail\n");
    
                    stringBuilder.Append("\nId: ");
                    stringBuilder.Append(item.Id);
                    stringBuilder.Append("\nDomain: ");
                    stringBuilder.Append(item.Domain);
                    stringBuilder.Append("\nActivationCode: ");
                    stringBuilder.Append(item.ActivationCode);
                }
            }
            else
            {
                throw new ApplicationException(result.ResultMessage);
            }
        }
        catch (Exception ex)
        {
            // re-run the error
            throw new ApplicationException(ex.Message);
        }
    
        return stringBuilder.ToString();
    }
    
    /// IWsCommon.GetUserOtp  Method (JAVA)
    public static String GetUserOtp(IWsCommon client)
    {
        ///specify the account login details 
        ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
        ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.PASSWORD_PROPERTY, "0123456789");
    
        StringBuilder StringBuilder = new StringBuilder();
    
        try
        {
            // call method GetUserOtp 
            // obtaining a WsResultOfUserDataOtp item
            WsResultOfUserDataOtp result = client.getUserOtp();
    
            // if the call is Success print returned values
            if (result.isSuccess())
            {
                StringBuilder.append("Operation ends successfully\n");
    
                // get Value returned from server
                UserDataOtp item = result.getValue();
    
                if (item != null)
                {
                    StringBuilder.append("UserDataOtp detail\n");
    
                    StringBuilder.append("\nId: ");
                    StringBuilder.append(item.getId());
                    StringBuilder.append("\nDomain: ");
                    StringBuilder.append(item.getDomain());
                    StringBuilder.append("\nActivationCode: ");
                    StringBuilder.append(item.getActivationCode());
                }
            }
            else
            {
                throw new Exception(result.getResultMessage());
            }
        }
        catch (Exception ex)
        {
            // re-run the error
                System.out.println(ex);
        }
    
        return StringBuilder.toString();
    }
    
    Version
    API: v2.7 URL:https://api.dc1.computing.cloud.it/WsCommon/v2.7/WsCommon.svc?wsdl