Access Manager

Enterprise Browser 5.0

Overview

The Access Manager module (eb.accessmgr.js) exposes APIs that allow an EB app to acquire access to another app's secure interfaces. On Zebra devices running Android 11 and later, such permissions are handled by the Zebra Device Manager (ZDM) service. Apps calling for access to another app's interface(s) must be explicitly granted permission by the implementing app to do so. This requires the calling app to interface with ZDM.

When an app attempts to use an interface that the implementing app has chosen to protect using a Delegation Scope, the implementing app must query ZDM to determine whether the calling app has been granted (by the administrator) a Delegation Scope that grants access to that interface.

Introduced with EB 3.5.


Enabling the API

There are two methods of enabling the AccessMgr API:

  • Include all ebapi modules
  • Include only the required API modules

Both are explained below.

For either method, one or more files must be copied to the device from /Enterprise Browser/JavaScript Files/Enterprise Browser, a directory on the computer that contains the Enterprise Browser installation.

Include all JS API modules

To include all JavaScript APIs, copy the ebapi-modules.js file to a location accessible by the app's files and include a reference to the JavaScript modules file in the app. For instance, to include the modules file in the index.html, copy it to the same directory as the app's index.html file and add the following line to the HTML's HEAD section:


<script type="text/javascript" charset="utf-8" src="ebapi-modules.js"></script>

The code above defines the EB class within the page. Note that the path for this file is relative to the current page (index.html). Any page on which the API modules are required must include a reference to the required .js file(s) in this fashion.

Include only the required modules

To include individual APIs, first include a reference to the ebapi.js file in the HTML and then to the additional required API file(s). For instance, to use the Access Manager API, add the following code to the HTML file(s). Again, this assumes that relevant API files have been copied to the same directory as the HTML.


<script type="text/javascript" charset="utf-8" src="ebapi.js"></script>
<script type="text/javascript" charset="utf-8" src="eb.accessmgr.js"></script>

In the lines above, notice that ebapi.js is included first, followed by eb.accessmgr.js, which is the EB Access Manager API. Similar coding is required on any HTML page that calls this or any other individual API.

The ebapi.js file is necessary for all single-API inclusions.

Methods

acquireToken(STRING serviceIdentifierName)

An application that requires a token to call interfaces of another app can obtain it using the ZDM Content Provider. The caller app must send the Delegation Scope name as defined by the implementing app as part of the column value. If the caller app is granted the same Delegation Scope, ZDM generates and returns a token valid for 24 hours. Otherwise, a SecurityException is generated.

Learn more about ZDM queries

Parameters

  • path: STRING
    • Service Identifier name
  • Returns
    • STRING: Returns a token. To generate a token, add app to the whitelist (aka 'allowlist') using MX Access Manager.

Learn more about whitelisting

Platforms

  • Android

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • EB.Accessmgr.acquireToken(STRING serviceIdentifiername)