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
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):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 tohttps://<Application Server>/Flexicapture12/Server/Saml. The name of the field containing the SAML data should be SAMLResponse.
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:
<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 namedFlexiCaptureTmpPrn) or an Authorization: Bearer header. Example:
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 theAllowMixedModeCertificateValidation 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.