Skip to main content

Getting Started

Entrust Identity as a Service (IDaaS) Authentication API client provides integrations with the IDaaS Authentication API.

info

Read the installation instructions before continuing.

Create an Authentication API application in IDaaS

  1. Go to your IDaaS Admin portal and navigate to Resources > Applications.
  2. Click + and then select Authentication API from the list of available applications.
  3. In the General tab, enter the name and the description of your application.
  4. Click Next.
  5. In the Setup tab, set the Source of Client IP Address for Risk Conditions.
  6. In the Complete tab, click Copy to copy the applicationID to your clipboard. You need the applicationID to initialize the Authentication API. Example: 9aaf0071-3f79-4663-9782-932c7d53c3da.
  7. Add a resource rule to your Authentication API application.
Note

A resource rule must be added to your Authentication API application.

Available APIs

Identity as a Service uses three API calls to complete an authentication challenge:

  1. Get User's Authenticators.
  2. Select Authenticator.
  3. Complete Authentication Challenge.

These API calls must be made sequentially to complete Identity as a Service authentication. The response to each API call contains information that is required to complete the next call. Completing each of these API calls, in order, allows users to log in to the application.

Available Authenticators

  1. MACHINE
  2. PASSWORD
  3. EXTERNAL
  4. KBA
  5. TEMP_ACCESS_CODE
  6. OTP
  7. GRID
  8. TOKEN
  9. TOKENPUSH
  10. FIDO
  11. SMARTCREDENTIALPUSH
  12. PASSWORD_AND_SECONDFACTOR

Initialize the Authentication API Client

In order the make the calls to the API, you need to initialize the Authentication API client using the applicationID you copied in step 6 above.

import com.entrustdatacard.intellitrust.auth.ApiClient;
import com.entrustdatacard.intellitrust.auth.api.AuthenticationApi;
import com.entrustdatacard.intellitrust.auth.model.AuthenticatedResponse;
import com.entrustdatacard.intellitrust.auth.model.UserAuthenticateParameters;
import com.entrustdatacard.intellitrust.auth.model.UserChallengeParameters;

public class Main {
private static final String APPLICATION_ID = "YOUR_APPLICATION_ID";
private static final String HOST_NAME = "YOUR_HOST_NAME";

public static void main(String args[]) throws Exception {
// initialize the API client with the IDaaS hostname
ApiClient apiClient = new ApiClient();
apiClient.setBasePath(HOST_NAME);
}
}

Try some API Requests

After initializing the client, you can make the API calls. The following example shows how to make the API calls to authenticate a user. To authenticate the user, the user must be registered in IDaaS and be assigned the required authenticators used for authentication.

String authType = args[0];
String userId = args[1];

UserChallengeParameters challengeParms = new UserChallengeParameters();
challengeParms.setApplicationId(APPLICATION_ID);
challengeParms.setUserId(userId);

AuthenticatedResponse challengeResponse = authApi.userChallengeUsingPOST(authType, challengeParms);

String response = System.console().readLine("Enter response: ");
UserAuthenticateParameters authParms = new UserAuthenticateParameters()
.setApplicationId(APPLICATION_ID)
.setResponse(response)
authApi.userAuthenticateUsingPOST(authType, authParms, challengeResponse.getToken());

Full Example Snippet

package com.entrust.idaas.userAuthenticate;

import com.entrustdatacard.intellitrust.auth.ApiClient;
import com.entrustdatacard.intellitrust.auth.api.AuthenticationApi;
import com.entrustdatacard.intellitrust.auth.model.*

public class UserAuthenticate {
private static final String APPLICATION_ID = "YOUR_APPLICATION_ID";
private static final String HOST_NAME = "YOUR_HOST_NAME";

public static void main(String args[]) throws Exception {
ApiClient apiClient = new ApiClient();
apiClient.setBasePath(HOST_NAME);
AuthenticationApi authApi = new AuthenticationApi(apiClient);

if (args.length != 2) {
System.err.println("userAuthenticate <authType> <userId>");
System.exit(-1);
}
String authType = args[0];
String userId = args[1];

UserChallengeParameters challengeParms = new UserChallengeParameters();
challengeParms.setApplicationId(APPLICATION_ID);
challengeParms.setUserId(userId);

AuthenticatedResponse challengeResponse = authApi.userChallengeUsingPOST(authType, challengeParms);

String response = System.console().readLine("Enter response: ");
UserAuthenticateParameters authParms = new UserAuthenticateParameters()
.setApplicationId(APPLICATION_ID)
.setResponse(response)
authApi.userAuthenticateUsingPOST(authType, authParms, challengeResponse.getToken());
}
}
danger

The sample code above is for demonstration purposes only. It is not intended to be used in production. Make sure to properly validate the input parameters and handle any exceptions that may occur. You should also use a secure method to set the application ID and host name.

More Examples

For more examples, click here.