Skip to main content

Overview of the authentication process

SAML authentication keeps identity data, such as a user name and password, away from the Application Server. Instead, the user authenticates on a third-party identity provider such as Google or Facebook. That trusted third party then passes proof of successful authentication to the Application Server. The SAML authentication process on a user application consists of the following steps:
  • Authenticate on the third-party identity provider
  • Get the user’s SAML authentication data from the third-party identity provider
  • Send the SAML authentication data to the Application Server
  • Receive an authenticated ticket from the Application Server
This ticket can then be used in requests to the Application Server.
The user account must exist in the FlexiCapture database, with all of the required permissions.

Implementation

Get SAML data

SAML data from the third-party identity provider is formatted as follows (this example is from OneLogin):
For details on how to get authentication data from a third-party identity provider, see the identity provider’s documentation. For instance, OneLogin offers ready-to-use toolkits for enabling SAML authentication in several programming languages.

Send SAML data to FlexiCapture 12 Application Server

Encode the SAML data in Base64 and send it to the Application Server by making a POST request to https://<Application Server>/Flexicapture12/Server/Saml. The name of the field containing the SAML data should be SAMLResponse.
If you are using a tenant, add the tenant’s identifier to the server URL, for example, https://<ApplicationServer>/Flexicapture12/Server/Saml?Tenant=MyTenantName For authentication to work, a user with a login matching the identifier in the SAML data must be registered on the Application Server. The value of the /samlp:Response/saml:Assertion/saml:Subject/saml:NameID field will be used as the login. The Application Server returns a response like this:
The value in the <ticket> tag is the authenticated FlexiCapture 12 ticket. You can use this ticket to make calls to all Application Server interfaces that require authentication. Requests to FlexiCapture web services must be made using FlexiCapture authentication (addresses starting with https://<ApplicationServer>/flexicapture12/Server/FCAuth/ or https://<ApplicationServer>/flexicapture12/Server/MobileApp/).

Use the authenticated FlexiCapture 12 ticket

You can pass the ticket to the server using a cookie file (the file must be named FlexiCaptureTmpPrn) or an Authorization: Bearer header. Example:
Use the header. Cookies are supported for compatibility with older solutions. On success, the server’s response carries an updated ticket value in two places. One is a cookie file with the same login, FlexiCaptureTmpPrn, and the other is the AuthTicket header. Use the updated ticket for the next request, since tickets expire after a time.

Set up a trusted certificate on the Application Server

The Application Server will check the data received from the identity provider. For the Application Server to trust this data, sign it with a custom certificate. The issuing authority must appear in the Application Server database of trusted authorities. Import the certificate to the ABBYY FlexiCapture database. Now data will be checked using this certificate. For more information, see Set up Single Sign-On. If the check fails, the Application Server refers to the AllowMixedModeCertificateValidation parameter under <appSettings> in the Web.config file. When that parameter is true, the check uses the certificate in the Trusted Root Certification Authorities folder. That folder sits in the Local Computer certificate store on the computer running the Application Server. If the database holds no certificates, the check falls back to the certificate in the Trusted Root Certification Authorities folder. The AllowMixedModeCertificateValidation parameter is then ignored. A sample project and its accompanying materials are available as SAML_Example.zip.