cordova-plugin-mas-core
Version:
Cordova MAS Foundation Plugin
3,611 lines (860 loc) • 106 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#line713">line 713</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#line754">line 754</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#line701">line 701</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 tha