While OmniStar is an all-in-one product that allows for the management of grants, ethics and research applications and projects across their complete lifecycle, we find that these systems are rarely implemented in isolation. As such, there is significant business value in exposing different functionality to both other systems within the main organisation as well as trusted third parties.
OmniStar provides this capability through a number of distinct APIs and integration points:
- Authentication providers (OmniStar Platform Authentication)
- User Registration API
- Lookup API
- Database API
- Processing API
- Reporting API
- Application interop
- In-system Data Migration/Import functionality
All of these deal with potentially sensitive data and so all are authenticated based on the requirements that consumers are likely to have.
Multiple different authentication methods are provided for the external connectivity functionality. These include:
- HMACSHA256 based signed requests;
- Client certificate based authentication.
OmniStar authenticates browser-based users with an encrypted authentication cookie sent on each request. While the API generally does allow for access via this method, it is generally not recommended. Similarly, other methods are in place for other functionality (e.g. Kerberos for local services, signing certificates for SAML IdPs etc.) but are outside of the scope covered here.
HMAC-based authentication is provided across the Omni external connectivity points. This authentication method involves signing each HTTP request with a pre-shared secret key (and including a corresponding access key along with the request).
At a high level, generating a request involves the following process:
- Adding signature metadata (version/cypher).
- Providing a timestamp. OmniStar will check this timestamp and if outside of a predefined clock skew will reject the request;
- Calculating the hash-based message authentication code from a pre-shared secret signing key.
- Adding the signature to the request via the Authorization header.
When OmniStar receives a request, it performs validation steps to ensure that the request is genuine – looking at the timestamp, request structure, finally generating an authentication code from the same request. Once that’s done, the system ensures that the generated authentication code matches the one provided in the original request.
This approach is in line with industry practice (mirroring approaches used by organisations like Amazon for access to protected S3 resources). The cyphers used are well known, secure and battle tested. The use of canonicalized timestamped requests and encrypted data being transferred minimises the potential attack surface even if the secure channel is compromised.
Before calling the OmniStar APIs, use the OmniStar internal portal to create one or more system access keys. Visit Administration > System Access Keys as a user with sufficient permissions (i.e. system admin). Add a System Access Key that applies to the type of information you plan to retrieve from the system using the APIs.
For more information on HMAC Access Key Purpose, refer to HMAC Access Key Purpose.
Select “Add system access key” from the Action menu:
Please note that the system automatically generates random Access key and Access secret when adding a new key:
If your application is accessing OmniStar remotely, then it needs to authenticate itself by including the Omni Authentication header with all requests. Version1 of the signature can be generated as follows:
- Create the raw string to sign. This is the concatenation of multiple request parts:
- System Access Key
- HTTP method (eg "POST")
- Request URI (lowercase, absolute URI including action path)
- A request timestamp (seconds since the UNIX epoch)
- A random nonce (e.g. a guid)
- The request content's MD5 hash as a Base64 string. In the case of a HTTP GET or other operation without content, this piece is excluded.
- Compute the hash using HMACSHA256 (with the system access key's secret as the initialisation bytes). To convert this from unprintable bytes, encode this with Base64.
- Attach an Authentication header based on the concatenation of the following:
- "Omni " (the scheme, followed by a space)
- System Access Key
- : (a colon)
- Encoding of the signature computed in 2
- : (a colon)
- The nonce
- : (a colon)
- The request timestamp
The following script block can be used by tools such as Telerik Fiddler and demonstrates the algorithm end-to-end.
The Base.Interop library (F1Solutions.OmniStar.Base.Interop.dll) provided as part of OmniStar software contains functionality to perform the steps listed above transparently when using a .NET HttpClient. If you wire in F1Solutions.OmniStar.Base.Interop.HmacClientHandler with valid keys, it should be possible to call API methods without needing to handle authentication separately.
Example – Retrieving a sign in token (via the Registration and Authentication API)
Here is a PowerShell example that demonstrates how to create the authentication header using the Base.Interop library.
$omniUrl = Read-Host -Prompt 'Omni URL (eg
$accessKey = Read-Host -Prompt 'Access key'
$accessSecret = Read-Host -Prompt 'Access secret'
$username = Read-Host -Prompt 'Username'
$password = Read-Host -Prompt 'Password'
Add-Type -Path '<Path>\Base.Interop\bin\debug\F1Solutions.OmniStar.Base.Interop.dll'
Add-Type -Path '<Path>\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll
$url = $omniUrl + '/api/Account/GenerateSignInToken'
$hmacHandler = New-Object F1Solutions.OmniStar.Base.Interop.HmacClientHandler -ArgumentList $accessKey, $accessSecret
$hmacHandler.InnerHandler = New-Object System.Net.Http.HttpClientHandler
$httpClient = New-Object System.Net.Http.HttpClient -ArgumentList $hmacHandler
$request = New-Object F1Solutions.OmniStar.Base.Interop.Account.SignInRequest
$request.Username = $username
$request.Password = $password
$serialisedRequest = [Newtonsoft.Json.JsonConvert]::SerializeObject($request)
$content = New-Object System.Net.Http.StringContent($serialisedRequest, [System.Text.Encoding]::UTF8, "application/json")
$response = $httpClient.PostAsync($url, $content).Result
$sc = $response.StatusCode
Write-Host "Status: $sc"
$responseBody = $response.Content.ReadAsStringAsync().Result
Sample run of that script:
PS > .\TestSignIn.ps1
Omni URL (eg ):
Access key: MjM2LDQ0LDUsMTY5LDEzNSw5MSwxODYsMTY5LDEyNyw5
Access secret: MjYsMTc0LDEyMSwxNjEsNTgsMjQ4LDk3LDIzOSwxNzksOSwyMzEsMTE4LDI1NSw0NCwxMTgsMTcsMTcxLDIxNSwyNTAsNTQ=
This example pulls in the HmacClientHandler, attaches it to a new HttpClient and performs a POST request of the expected request payload to the authentication endpoint. The endpoint returns a JSON response.
Client-based Certificate Authentication
Application Interop is provided via WS-* WCF-based endpoints. These endpoints provide two-way security. Details on the configuration of client-based certificate authentication can be found in OmniStar Net Applications Interop.