Authentication
You can use the HTTP Basic or HMAC method of authentication to load the plugin's URL securely in the init stage.
HTTP Basic
Condition | Description |
---|---|
Oracle Fusion Field Service Configuration | On the Forms & Plugins page, select "HTTP Basic" authentication type. Fill up the Login and Password fields. These credentials are encrypted and saved to the Oracle Fusion Field Service database. |
Server Side | Configure the web server on which the plugin sources are hosted to return the HTTP 401
Unauthorized status, if you are requesting the configured plugin URL without the
credentials. See the NGINX and Apache documents for details. The server must return the
plugin content if its URL is requested with the HTTP header. |
Client Side | When the user logs in, Oracle Fusion Field Service reads the credentials from the
database and loads the plugin URL into the hidden iframe as follows: <iframe
src="https:// mylogin:mypass@example.com/myPlugin.php"/> This way, the browser
loads the plugin sources over HTTPS using HTTP Basic
Authentication:
|
HMAC Authentication
HMAC (Hash based message authentication code) lets you sign HTTP
requests and their GET parameters. The HMAC signature ensures that
the URL is generated by an authorized source. The MAC signature (digest)
is added as an additional GET parameter at the end of a query string: <!CDATA[[http://www.example.com/path?user=test§ion=D%26G&activity=33&hmac=D2BJn9P1EcLhaFrNhbAzCQTVQXCCwCBQsrg8V6h4YoU%3D]]>
HMAC Function Algorithm
hmac =
BASE64(HMAC-SHA-256(data, SHA256(SecretKey)))
. SHA - 256 accepts SecretKey as a string
and returns the hash string. The secret key is configured per plugin in the Add
plugin and Modify plugin pages in Oracle Fusion Field Service Core Application, hashed by SHA256, encrypted and stored in the database.
HMAC-SHA-256 accepts data and key as strings and returns a binary array of HMAC signature. BASE64
accepts the binary array and returns BASE64 encoded string. Data required for generating HMAC is
query resource location with query parameters sorted lexicographically:-
Remove the protocol identifier from the URL together with colon and slashes ( http:// or https:// ).
-
Remove the resource name and port from the URL.
-
Append query location to the output string.
-
If there are query parameters append the character ? to the output string.
-
Decode every name and value for URL parameters.
-
Sort the list of parameters alphabetically by name.
-
For each name/value pair:
-
Append the encoded name to the output string.
-
Append the ‘=’ character to the output string.
-
Append the encoded value to the output string.
-
-
If there are more key/value pairs remaining, append an & character to the output string.
http://www.example.com/path?user=test§ion=D%26G&activity=33 => www.example.com/path?user=test§ion=D%26G&activity=33
www.example.com/path?user=test§ion=D%26G&activity=33 => /path?user=test§ion=D%26G&activity=33
data = '/path'
data = '/path?'
['user'='test','section'='D&G','activity'=33]
['activity'=33,'section'='D&G','user'='test']
['activity'=33,'section'='D&G', 'user'='test'] => data
data = '/path? activity'
data = '/path? activity='
data = '/path? activity=33'
data = '/path? activity=33&'
data = '/path? activity=33§ion=D %26G&user=test'
The full signed URL is 'http://www.example.com/path?user=test§ion=D%26G&activity=33&hmac=D2BJn9P1EcLhaFrNhbAzC QTVQXCCwCBQsrg8V6h4YoU%3D'