Adding the Token Generator to a LOB Application - Legacy Authentication Methods - Foundation 23.1 - Foundation 23.1 - Ready - OnBase - Essential - Premier - Standard - external - Standard - Essential - Premier

Legacy Authentication Methods

Legacy Authentication Methods
Foundation 23.1

The OnBase Entrust token is generated using one of two methods:

  • GenerateToken: Accepts an OnBase user name and generates an Entrust token using that user name.

  • GenerateTokenAfterVerifyingPassword: Accepts an OnBase user name and password, and generates an Entrust token only after verifying the user name and password.

To use the OnBase Entrust token generator in your LOB application:


The following examples are shown in C#.

  1. Add a reference to Hyland.OnBaseEntrust.dll, then add the appropriate using statement in your code. For example:
    using Hyland.OnBaseEntrust;
  2. Construct a new instance of the token generator class and call either GenerateToken or GenerateTokenAfterVerifyingPassword. For example:

    TokenGenerator generator = new TokenGenerator();

    TokenResult result = generator.GenerateToken();

    • If you call GenerateToken, you must pass the OnBase user name, such as:

      TokenResult result = generator.GenerateToken(username_string);

    • If you call GenerateTokenAfterVerifyingPassword, you must pass the OnBase user name and password, such as:

      TokenResult result = generator.GenerateTokenAfterVerifyingPassword (username_string,password_string);

  3. The method called returns the TokenResult object, which contains the result of the token generation call in three properties:
    • result.Exception: Contains any exceptions thrown during the token generation process. If no exceptions were thrown, this property returns null.

    • result.Status: An enumeration that returns the status of the token generation:

      • TokenGeneratorStatus.ExceptionOccurredWhenGeneratingToken: An exception occurred when the token was being generated.

      • TokenGeneratorStatus.FailedToObtainPrivateKey: Failed to obtain the private key required to digitally sign the token.

      • TokenGeneratorStatus.Success: The OnBase Entrust token was successfully generated.

      • TokenGeneratorStatus.UnableToVerifyPassword: An exception occurred when attempting to verify the password provided.

      • TokenGeneratorStatus.UsernameOrPasswordInvalid: The user name or password provided is invalid.

    • result.Token: The string representation of the token generated.

  4. The token generated must be passed to the OnBase web server as an HTTP post parameter called entrusttoken.