cordova-plugin-mas-core-mba
Version:
Cordova MAS Foundation Plugin
7,181 lines • 99.2 kB
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: MASPluginMAS</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: MASPluginMAS</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>MASPluginMAS</h2>
<div class="class-description">This main class contains the functions for MAS Lifecycle Management.
<table>
<tr bgcolor="#D3D3D3"><th>MASPluginMAS Construtor</th></tr>
<tr><td><i>var MAS = new MASPlugin.MAS();</i></td></tr>
</table></div>
</header>
<article>
<div class="container-overview">
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line12">line 12</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="authorize"><span class="type-signature"></span>authorize<span class="signature">(successHandler, errorHandler, code)</span><span class="type-signature"></span></h4>
<div class="description">
This method is used to authorize the application and user via QRCode session transfer. The user scans and fetches the auth_code from a QRCode
on another device/application and uses this API to send the code to MAG server to authorize the session on another device.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>code</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The code extracted by the QRCode scanner</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line659">line 659</a>
</li></ul></dd>
</dl>
<h4 class="name" id="cancelAuthentication"><span class="type-signature"></span>cancelAuthentication<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Cancels the current user's authentication session process. Generally called when Cancel button is clicked on Authentication UI.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line319">line 319</a>
</li></ul></dd>
</dl>
<h4 class="name" id="cancelGenerateAndSendOTP"><span class="type-signature"></span>cancelGenerateAndSendOTP<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Cancels the current session of OTP Generation process. To be called in scenario when Cancel button is clicked on the OTP Channel Selection screen.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line361">line 361</a>
</li></ul></dd>
</dl>
<h4 class="name" id="cancelOTPValidation"><span class="type-signature"></span>cancelOTPValidation<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Cancels the current OTP validation process of the user. To be called in scenario when Cancel button is clicked on the OTP validation screen.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line396">line 396</a>
</li></ul></dd>
</dl>
<h4 class="name" id="completeAuthentication"><span class="type-signature"></span>completeAuthentication<span class="signature">(successHandler, errorHandler, username, password)</span><span class="type-signature"></span></h4>
<div class="description">
Completes the current user's authentication session validation. Similar to the loginWithUsernameAndPassword API but used in case when login is pending due to a previous request in queue.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">username of the user.</td>
</tr>
<tr>
<td class="name"><code>password</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">password of the user.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line284">line 284</a>
</li></ul></dd>
</dl>
<h4 class="name" id="configFileName"><span class="type-signature"></span>configFileName<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Sets the name of the mobile configuration file. This gives the ability to set the file's name to a custom value.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>fileName.</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Must be a JSON file similar to the msso_config.json file.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line225">line 225</a>
</li></ul></dd>
</dl>
<h4 class="name" id="deleteFromPath"><span class="type-signature"></span>deleteFromPath<span class="signature">(successHandler, errorHandler, path, parametersInfo, headersInfo, requestType, responseType, isPublic)</span><span class="type-signature"></span></h4>
<div class="description">
Invokes an API on the Gateway using the HTTP DELETE method.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>path</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The API path which the user wants to access. For example, /protected/endpoint/score</td>
</tr>
<tr>
<td class="name"><code>parametersInfo</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Query Parameters to be passed along with the request. <table><tr><th>Example</th></tr><tr><td>{<br> "x-otp":"2345",<br> "empName":"Jon"<br>}</td></tr></table></td>
</tr>
<tr>
<td class="name"><code>headersInfo</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">The HTTP Headers to be passed along with the request.<table><tr><th>Example</th></tr><tr><td>{<br> "Content-Type":"application/xml",<br> "reload-cache":"true"<br>}</td></tr></table></td>
</tr>
<tr>
<td class="name"><code>requestType</code></td>
<td class="type">
<span class="param-type"><a href="MASPluginConstants.html#.MASRequestResponseType">MASPluginConstants.MASRequestResponseType</a></span>
</td>
<td class="description last">specifies the request type of the request.<br></td>
</tr>
<tr>
<td class="name"><code>responseType</code></td>
<td class="type">
<span class="param-type"><a href="MASPluginConstants.html#.MASRequestResponseType">MASPluginConstants.MASRequestResponseType</a></span>
</td>
<td class="description last">specifies the response type of the request</td>
</tr>
<tr>
<td class="name"><code>isPublic</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">specifies if the API being called is public or not</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line589">line 589</a>
</li></ul></dd>
</dl>
<h4 class="name" id="doSocialLogin"><span class="type-signature"></span>doSocialLogin<span class="signature">(successHandler, errorHandler, provider)</span><span class="type-signature"></span></h4>
<div class="description">
The API to perform social login. Based on the provider being selected, it redirects to the login provider's oauth flow and performs Authorization and Authentication for the user.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>provider</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">An identifier of the social login provider that is defined on MAG server. Values : `google`, `facebook` etc.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line301">line 301</a>
</li></ul></dd>
</dl>
<h4 class="name" id="enableBrowserBasedAuthentication"><span class="type-signature"></span>enableBrowserBasedAuthentication<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Enables Browser-based authentication i.e. instead of the default login UI, it would redirect to the browser-based UI that is developed and stored on MAG server.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line211">line 211</a>
</li></ul></dd>
</dl>
<h4 class="name" id="enableIdTokenValidation"><span class="type-signature"></span>enableIdTokenValidation<span class="signature">(successHandler, errorHandler, enableValidation)</span><span class="type-signature"></span></h4>
<div class="description">
Sets boolean indicator of enforcing id_token validation upon device registration/user authentication.
id_token is being validated as part of authentication/registration process against known signing algorithm.<br>
Mobile SDK currently supports following algorithm(s): - HS256<br>
Any other signing algorithm will cause authentication/registration failure due to unknown signing algorithm.<br>
If the server side is configured to return a different or custom algorithm, ensure to disable id_token validation to avoid any failure on Mobile SDK.<br>
By default, id_token validation is enabled and enforced in authentication and/or registration process; it can be opted-out.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>enableValidation</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">BOOLEAN value that indicates whether id_token validation is enabled or not.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line700">line 700</a>
</li></ul></dd>
</dl>
<h4 class="name" id="enableJwksPreload"><span class="type-signature"></span>enableJwksPreload<span class="signature">(successHandler, errorHandler, enable)</span><span class="type-signature"></span></h4>
<div class="description">
Enable JWKS preloading.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>enable</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">True to enable JWKS preloading. False to disable JWKS preloading. Default value is 'false'</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line499">line 499</a>
</li></ul></dd>
</dl>
<h4 class="name" id="enablePKCE"><span class="type-signature"></span>enablePKCE<span class="signature">(successHandler, errorHandler, enable)</span><span class="type-signature"></span></h4>
<div class="description">
Enable PKCE extension to OAuth.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>enable</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">The behaviour of this flag would be
<table>
<tr bgcolor="#D3D3D3"><th>Value</th><th>Description</th>
<tr><td>true</td><td>Enable PKCE extension i.e. while authorizing enable PKCE based validation</td>
<tr><td>false</td><td>Disable PKCE extension</td></tr>
</table></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line469">line 469</a>
</li></ul></dd>
</dl>
<h4 class="name" id="gatewayIsReachable"><span class="type-signature"></span>gatewayIsReachable<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Checks whether the Gateway is reachable or not.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line536">line 536</a>
</li></ul></dd>
</dl>
<h4 class="name" id="generateAndSendOTP"><span class="type-signature"></span>generateAndSendOTP<span class="signature">(successHandler, errorHandler, channels)</span><span class="type-signature"></span></h4>
<div class="description">
Requests server to generate and send OTP to the channels provided.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>channels</code></td>
<td class="type">
<span class="param-type">Array.<string></span>
</td>
<td class="description last">user defined variable that is an array of channels where the OTP is to be delivered. For example, ['sms','email']</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line335">line 335</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getFromPath"><span class="type-signature"></span>getFromPath<span class="signature">(successHandler, errorHandler, path, parametersInfo, headersInfo, requestType, responseType, isPublic)</span><span class="type-signature"></span></h4>
<div class="description">
Invokes an API on the Gateway using the HTTP GET method.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>path</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The API path which the user wants to access. For example, /protected/endpoint/score</td>
</tr>
<tr>
<td class="name"><code>parametersInfo</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Query Parameters that is passed along with the request. <table><tr><th>Example</th></tr><tr><td>{<br> "x-otp":"2345",<br> "empName":"Jon"<br>}</td></tr></table></td>
</tr>
<tr>
<td class="name"><code>headersInfo</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">The HTTP Headers that is passed along with the request.<table><tr><th>Example</th></tr><tr><td>{<br> "Content-Type":"application/xml",<br> "reload-cache":"true"<br>}</td></tr></table></td>
</tr>
<tr>
<td class="name"><code>requestType</code></td>
<td class="type">
<span class="param-type"><a href="MASPluginConstants.html#.MASRequestResponseType">MASPluginConstants.MASRequestResponseType</a></span>
</td>
<td class="description last">specifies the request type of the request.<br></td>
</tr>
<tr>
<td class="name"><code>responseType</code></td>
<td class="type">
<span class="param-type"><a href="MASPluginConstants.html#.MASRequestResponseType">MASPluginConstants.MASRequestResponseType</a></span>
</td>
<td class="description last">specifies the response type of the request</td>
</tr>
<tr>
<td class="name"><code>isPublic</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">specifies if the API being called is public or not</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line570">line 570</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getMASState"><span class="type-signature"></span>getMASState<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Returns current value of the <a href="MASPluginConstants.html#.MASState">MASPluginConstants.MASState</a>. The value can be used to determine the current state of the SDK.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line647">line 647</a>
</li></ul></dd>
</dl>
<h4 class="name" id="grantFlow"><span class="type-signature"></span>grantFlow<span class="signature">(successHandler, errorHandler, MASGrantFlow)</span><span class="type-signature"></span></h4>
<div class="description">
Sets the OAuth grant type property. This should be set before MAS start is called
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>MASGrantFlow</code></td>
<td class="type">
<span class="param-type"><a href="MASPluginConstants.html#.MASGrantFlow">MASPluginConstants.MASGrantFlow</a></span>
</td>
<td class="description last">The desired OAuth Flow to be set for this session.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line266">line 266</a>
</li></ul></dd>
</dl>
<h4 class="name" id="initialize"><span class="type-signature"></span>initialize<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Initializes the MAS plugin. This includes setting of the various listeners that are required for authenticating the user while registration of the application with the Gateway
and accessing various protected API. All other initialization related setting must be done in this method.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line28">line 28</a>
</li></ul></dd>
</dl>
<h4 class="name" id="isIdTokenValidationEnabled"><span class="type-signature"></span>isIdTokenValidationEnabled<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Gets boolean indicator of enforcing id_token validation upon device registration/user authentication.
id_token is being validated as part of authentication/registration process against known signing algorithm.<br>
Mobile SDK currently supports the <b>HS256</b> algorithm<br>
Any other signing algorithm will cause authentication/registration failure due to unknown signing algorithm.<br>
If the server side is configured to return a different or custom algorithm, ensure to disable id_token validation to avoid any failure on Mobile SDK.<br>
By default, id_token validation is enabled and enforced in authentication and/or registration process; it can be opted-out.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line720">line 720</a>
</li></ul></dd>
</dl>
<h4 class="name" id="isJwksPreloadEnabled"><span class="type-signature"></span>isJwksPreloadEnabled<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Determines whether preloading of JWKS is enabled.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line512">line 512</a>
</li></ul></dd>
</dl>
<h4 class="name" id="isPKCEEnabled"><span class="type-signature"></span>isPKCEEnabled<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Determines whether PKCE extension is enabled.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line487">line 487</a>
</li></ul></dd>
</dl>
<h4 class="name" id="postToPath"><span class="type-signature"></span>postToPath<span class="signature">(successHandler, errorHandler, path, parametersInfo, headersInfo, requestType, responseType, isPublic)</span><span class="type-signature"></span></h4>
<div class="description">
postToPath does the HTTP POST call to the Gateway. This expects at least three mandatory parameters as shown in the below example. The requestType and responseType are the optional parameters. If the requestType and responseType is not present, then it is set to the Default Type to JSON.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>path</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">path to the url. For example, "/protected/resource/*"</td>
</tr>
<tr>
<td class="name"><code>parametersInfo</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Query Parameters to be passed along with the request. <table><tr><th>Example</th></tr><tr><td>{<br> "x-otp":"2345",<br> "empName":"Jon"<br>}</td></tr></table></td>
</tr>
<tr>
<td class="name"><code>headersInfo</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">The HTTP Headers to be passed along with the request.<table><tr><th>Example</th></tr><tr><td>{<br> "Content-Type":"application/xml",<br> "reload-cache":"true"<br>}</td></tr></table></td>
</tr>
<tr>
<td class="name"><code>requestType</code></td>
<td class="type">
<span class="param-type"><a href="MASPluginConstants.html#.MASRequestResponseType">MASPluginConstants.MASRequestResponseType</a></span>
</td>
<td class="description last">specifies the request type of the request.<br></td>
</tr>
<tr>
<td class="name"><code>responseType</code></td>
<td class="type">
<span class="param-type"><a href="MASPluginConstants.html#.MASRequestResponseType">MASPluginConstants.MASRequestResponseType</a></span>
</td>
<td class="description last">specifies the response type of the request</td>
</tr>
<tr>
<td class="name"><code>isPublic</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">specifies if the API being called is public or not</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line627">line 627</a>
</li></ul></dd>
</dl>
<h4 class="name" id="putToPath"><span class="type-signature"></span>putToPath<span class="signature">(successHandler, errorHandler, path, parametersInfo, headersInfo, requestType, responseType, isPublic)</span><span class="type-signature"></span></h4>
<div class="description">
Invokes an API on the Gateway using the HTTP PUT method.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>path</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The API path which the user wants to access. For example, /protected/endpoint/score</td>
</tr>
<tr>
<td class="name"><code>parametersInfo</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Query Parameters to be passed along with the request. <table><tr><th>Example</th></tr><tr><td>{<br> "x-otp":"2345",<br> "empName":"Jon"<br>}</td></tr></table></td>
</tr>
<tr>
<td class="name"><code>headersInfo</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">The HTTP Headers to be passed along with the request.<table><tr><th>Example</th></tr><tr><td>{<br> "Content-Type":"application/xml",<br> "reload-cache":"true"<br>}</td></tr></table></td>
</tr>
<tr>
<td class="name"><code>requestType</code></td>
<td class="type">
<span class="param-type"><a href="MASPluginConstants.html#.MASRequestResponseType">MASPluginConstants.MASRequestResponseType</a></span>
</td>
<td class="description last">specifies the request type of the request.<br></td>
</tr>
<tr>
<td class="name"><code>responseType</code></td>
<td class="type">
<span class="param-type"><a href="MASPluginConstants.html#.MASRequestResponseType">MASPluginConstants.MASRequestResponseType</a></span>
</td>
<td class="description last">specifies the response type of the request</td>
</tr>
<tr>
<td class="name"><code>isPublic</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">specifies if the API being called is public or not</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line608">line 608</a>
</li></ul></dd>
</dl>
<h4 class="name" id="removeAuthCallbackHandler"><span class="type-signature"></span>removeAuthCallbackHandler<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Removes the authentication listener set by developer. This would fallback to the
default mechanism of Authentication that the CA Mobile Cordova Plugin handles.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line81">line 81</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setAuthCallbackHandler"><span class="type-signature"></span>setAuthCallbackHandler<span class="signature">(authHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Enables the developer to set its own Authentication Listener or callback handling
mechanism, which overrides the one that the CA Mobile Cordova Plugin sets. The developer needs to set their
business logic such as auditing etc. inside the authHandler function. The developer must call the
MAS.completeAuthentication or MAS.cancelAuthentication API from this function to unblock the original API call.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>authHandler</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">user defined authentication callback handling function</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line45">line 45</a>
</li></ul></dd>
</dl>
<h5>Example</h5>
<p class="code-caption">How the authHandler structure should look like</p>
<pre class="prettyprint"><code>function(result){
let requestType = result.requestType;
console.log(JSON.stringify(result));
if(requestType !== null && requestType === 'Login'){
mas.completeAuthentication(
function () {
console.log("Login successful");
},
function (error) {
let returnedError = "Internal Server Error";
if (error!=null && error.errorMessage != null) {
returnedError = JSON.stringify(error.errorMessage);
}
console.log("Error in Login::"+returnedError);
}, "username", "password");
// Or you can choose to cancel this request as below
// mas.cancelAuthentication(function() {},function (){});
}
}</code></pre>
<h4 class="name" id="setCustomLoginPage"><span class="type-signature"></span>setCustomLoginPage<span class="signature">(successHandler, errorHandler, customPage)</span><span class="type-signature"></span></h4>
<div class="description">
Sets the authentication UI handling page i.e. developer can override the default Authentication UI HTML using this API.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>customPage</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">user defined page if you want the plugin to use it.
"mas-login.html" is the default page.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line93">line 93</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setCustomOTPChannelsPage"><span class="type-signature"></span>setCustomOTPChannelsPage<span class="signature">(successHandler, errorHandler, customPage)</span><span class="type-signature"></span></h4>
<div class="description">
Sets the OTP Channels Selection UI handling page i.e. developer can override the default OTP Channel Selection UI HTML using this API.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>customPage</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">user defined page if you want the plugin to use it.
"mas-otpchannel.html" is the default page.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line129">line 129</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setCustomOTPPage"><span class="type-signature"></span>setCustomOTPPage<span class="signature">(successHandler, errorHandler, customPage)</span><span class="type-signature"></span></h4>
<div class="description">
Sets the OTP UI handling page i.e. developer can override the default OTP handling UI HTML using this API.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>customPage</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">user defined page if you want the plugin to use it.
"mas-otp.html" is the default page.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line164">line 164</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setSecurityConfiguration"><span class="type-signature"></span>setSecurityConfiguration<span class="signature">(successHandler, errorHandler, masSecurityConfiguration)</span><span class="type-signature"></span></h4>
<div class="description">
Sets the Security Configurations for External Servers. Invoke this API before making calls to external server.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>masSecurityConfiguration</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">A JSON representing the MASSecurityConfiguration struct.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line548">line 548</a>
</li></ul></dd>
</dl>
<h5>Example</h5>
<p class="code-caption">Populates and set the MASSecurityConfiguration object to the MAS Lifecycle</p>
<pre class="prettyprint"><code>var MAS = new MASPlugin.MAS();
var config = new MASPlugin.MASSecurityConfiguration();
var publicKeyHash = publicKeyHash;
config.setHost("mygw.ca.com");
config.setPublic("true");
config.addPublicKeyHash("jjHshjkslsk....sjsjjsjs");//server’s public key hash
MAS.setSecurityConfiguration(successHandler, errorHandler, config.getSecurityConfiguration());</code></pre>
<h4 class="name" id="signWithClaims"><span class="type-signature"></span>signWithClaims<span class="signature">(successHandler, errorHandler, claims)</span><span class="type-signature"></span></h4>
<div class="description">
Signs MASClaims object with the default private key.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>claims</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">claims in the form JSON object</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line673">line 673</a>
</li></ul></dd>
</dl>
<h4 class="name" id="signWithClaimsPrivateKey"><span class="type-signature"></span>signWithClaimsPrivateKey<span class="signature">(successHandler, errorHandler, claims, privateKey)</span><span class="type-signature"></span></h4>
<div class="description">
Signs MASClaims object with a custom private key.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>claims</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">claims in the form JSON object</td>
</tr>
<tr>
<td class="name"><code>privateKey</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">private key as a base64 encoded string</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line686">line 686</a>
</li></ul></dd>
</dl>
<h4 class="name" id="start"><span class="type-signature"></span>start<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Starts the lifecycle of the MAS processes i.e. Configuration loading, Listeners loading etc.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line412">line 412</a>
</li></ul></dd>
</dl>
<h4 class="name" id="startWithDefaultConfiguration"><span class="type-signature"></span>startWithDefaultConfiguration<span class="signature">(successHandler, errorHandler, defaultConfiguration)</span><span class="type-signature"></span></h4>
<div class="description">
Starts the lifecycle of the MAS processes. This will load the default JSON configuration rather than from the storage.If the SDK is already initialized, this method stops and restarts the SDK.
The default JSON configuration file should be msso_config.json. This will ignore the JSON configuration in the keychain storage and replace it with the default configuration.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>defaultConfiguration</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">The behaviour of SDK start would be
<table>
<tr bgcolor="#D3D3D3"><th>Value</th><th>Description</th>
<tr><td>true</td><td>The SDK load the default JSON configuration from msso_config.json packed in the app</td>
<tr><td>false</td><td>The SDK load the stored JSON configuration from local device storage from last run</td></tr>
</table></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line424">line 424</a>
</li></ul></dd>
</dl>
<h4 class="name" id="startWithJSON"><span class="type-signature"></span>startWithJSON<span class="signature">(successHandler, errorHandler, jsonObject)</span><span class="type-signature"></span></h4>
<div class="description">
Starts the lifecycle of the MAS processes with a specified JSON.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>jsonObject</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">The JSON object similar to msso_config.json content to be used to initialize the MAS SDK.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line443">line 443</a>
</li></ul></dd>
</dl>
<h4 class="name" id="startWithURL"><span class="type-signature"></span>startWithURL<span class="signature">(successHandler, errorHandler, url)</span><span class="type-signature"></span></h4>
<div class="description">
Starts the lifecycle of the MAS processes with given JSON configuration file path or URL.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>url</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">URL of the JSON configuration file path</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line456">line 456</a>
</li></ul></dd>
</dl>
<h4 class="name" id="stop"><span class="type-signature"></span>stop<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Stops the lifecycle of all MAS processes.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line524">line 524</a>
</li></ul></dd>
</dl>
<h4 class="name" id="useNativeMASUI"><span class="type-signature"></span>useNativeMASUI<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Use Native MASUI. By default, CA Mobile Cordova plugin uses the HTML login screen. This API overrides to use the native Mobile SDK UI.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line199">line 199</a>
</li></ul></dd>
</dl>
<h4 class="name" id="validateOTP"><span class="type-signature"></span>validateOTP<span class="signature">(successHandler, errorHandler, otp)</span><span class="type-signature"></span></h4>
<div class="description">
Validates the OTP i.e. User needs to validate the OTP via MAG server using this API.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>successHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#successCallbackFunction">successCallbackFunction</a></span>
</td>
<td class="description last">user defined success callback that is invoked on success scenario.</td>
</tr>
<tr>
<td class="name"><code>errorHandler</code></td>
<td class="type">
<span class="param-type"><a href="global.html#errorCallbackFunction">errorCallbackFunction</a></span>
</td>
<td class="description last">user defined error callback that is invoked on failure scenario.</td>
</tr>
<tr>
<td class="name"><code>otp</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">one-time password that the user receives for validation.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMAS.js.html">MASPluginMAS.js</a>, <a href="MASPluginMAS.js.html#line378">line 378</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="MASPlugin.html">MASPlugin</a></li><li><a href="MASPluginApplication.html">MASPluginApplication</a></li><li><a href="MASPluginAuthProviders.html">MASPluginAuthProviders</a></li><li><a href="MASPluginConstants.html">MASPluginConstants</a></li><li><a href="MASPluginDevice.html">MASPluginDevice</a></li><li><a href="MASPluginMAS.html">MASPluginMAS</a></li><li><a href="MASPluginSecurityConfiguration.html">MASPluginSecurityConfiguration</a></li><li><a href="MASPluginUser.html">MASPluginUser</a></li><li><a href="MASPluginUtils.html">MASPluginUtils</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Oct 29 2018 19:12:28 GMT+0530 (India Standard Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>