Configure OCR
The guide describes the advanced configuration of OCR. In most cases, the default configuration is enough.
Specify OCR profiles
To change the OCR authentication, consider the following set of profiles as a basis for your changes:
spring.profiles.active: basic-and-jwt-auth,rabbitmqQueue,s3-storage,mssql
There are five groups of profiles for the OCR Service that must be specified exactly one profile per group. Specify the same type of profiles in the ocr-rest.yml and ocr-worker.yml configuration files.
The profiles are grouped in the following way:
- Authentication
- File storage
note
Set up profiles in ocr-worker and ocr-rest consistently. You should have the same file storage and task storage profiles. ocr-worker does not require the authentication type and task storage and processing strategy profiles to be configured.
Set up authentication
The following profiles define an authentication type to apply:
disabled-auth: the authorization is not done for the OCR Service. All resources are accessed anonymously without authentication.basic-auth: the basic authentication is done. Some resources are accessible anonymously, the others require authentication.For basic authentication, configure a username and a password in
application.propertiesof ocr-rest:spring.security.username: your_username spring.security.password: your_passwordbasic-and-jwt-auth: both basic and JWT authentication are available. Some resources are accessible anonymously, the others require authentication.jwt-auth: the JWT authentication is done. All resources require authentication, except for the root path: /.
For JWT authentication, configure a JWT secret, an issuer, and the token expiration time inapplication.propertiesof ocr-rest:jwt.secret:your_jwt_secret jwt.expiration.minutes:60 jwt.issuer:workfusion
Configure S3 endpoint
The following profile specifies a file storage back-end to use – a technology to store OCR input and output payload:
s3-storage: files are stored in Amazon S3. You must specify theocr.bucketproperty.
S3 for ocr-rest:spring.profiles.active: basic-and-jwt-auth,rabbitmqQueue,s3-storage,mssql # Root folder to keep task input and output files (either in S3, depending on the active file storage profile). ocr.tasks.abbyy.storage.folder=abbyy_tasks --- spring.profiles: s3-storage aws.endpoint: # Endpoint to S3 or emulator. For example, http://127.0.0.1:9000 ocr.bucket: doc-upload # name of bucket to use for tasks aws.accessKeyId: # Access KeyID for specified endpoint aws.secretKey: # Secret Keyfor specified endpoint