A console application that simulates a service that periodically polls the database, demonstrates how to exchange the system user token for a system user ticket and call the tenant web services.
The primary objective of the example Service Console is to demonstrate how to use a certificate to sign a system user token, and use the signed system token, context identifier, and client secret to get a SystemIdToken – which contains the system user ticket.
The example also shows how to use the shared datasource.
The console uses a System.Threading.Timer to mimic a long-running service that performs periodic operations against multiple tenants.
- Every 15 seconds the timer elapses and initiates a query against the example database.
- The query gets all customers who are marked as Active. For each active customer, the service exchanges that customer's system user token for a system user ticket.
- With the new ticket, the service established a tenant database context and then authenticates the system user using the system user ticket.
Other than the console window, there is not GUI for this application. The console window will display only those log messages that indicate the process steps.