Using two factor authentication in your development environment

Your SAS API requests must include your client certificate. To find SAS API endpoints, see Signing web service.

Using two factor authentication with SoapUI

To use two factor authentication with SoapUI

  1. Open SoapUI.
  2. In the File menu, click Preferences.
  3. In the Preferences window, select the SSL Settings tab.
  4. On the SSL Settings tab, in the keyStore field enter your pkcs12 certificate. Then in the keyStorePassword field enter its password.
  5. Next to Client Authentication, select requires client authentication.
  6. To exit the Preferences window, click OK .
  7. Create a new SOAP project with the two factor authentication WSDL URL.
  8. Make a sample GetSigningServices call to make sure that client authentication is correctly configured.

Using two factor authentication with Java in Eclipse

To use two factor authentication with Java

  1. Open your SAS integration.
    You can also create a web service client from the two factor authentication WSDL. See Generating Java or C# classes from the WSDL document.
  2. Create a request with your client certificate; you can use a certificate in your file explorer.
java
System.setProperty("javax.net.ssl.keyStoreType", "PKCS12");
System.setProperty("javax.net.ssl.keyStore", "C:\\\\Program Files\\\\Java\\\\jdk1.8.0_25\\\\bin\\\\sas_keystore.p12");
System.setProperty("javax.net.ssl.keyStorePassword", "yourPassword");

If the call is successful, client authentication is correctly set up.

Using two factor authentication with C# in Visual Studio

To use two factor authentication with C#

  1. Open your SAS integration.
    You can also create a new solution with a web service reference to the two factor authentication WSDL. See Generating Java or C# classes from the WSDL document.
  2. Create a request with your client certificate.

You can use a certificate in your file explorer:

java
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;
//add client cert for two-factor-authentication
string clientCertPath = "C:\\Users\\Administrator\\Desktop\\sas_pfx.pfx";
string clientCertPassword = "yourPassword";
X509Certificate2 clientCert = new X509Certificate2(clientCertPath, clientCertPassword);
signingService.ClientCertificates.Add(clientCert);

You can also get the certificate from your personal keystore:

java
//create the service object
SigningService signingService = new SigningService();

//add client cert for two-factor-authentication
X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
store.Open(OpenFlags.ReadOnly);
//remove special characters and spaces from thumbprint
X509Certificate2 cert = store.Certificates.Find(X509FindType.FindByThumbprint, "6a49535545c010c63904d84528855846e21f8285", false).OfType<X509Certificate2>().First();

signingService.ClientCertificates.Add(cert);

We use cookies to ensure that we give you the best experience on our website. By using this site, you agree to the Terms of Service.