cordova-plugin-mas-core
Version:
Cordova MAS Foundation Plugin
3,973 lines (932 loc) • 52.3 kB
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: MASPluginUser</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: MASPluginUser</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>MASPluginUser</h2>
<div class="class-description">The main class representing the User Lifecycle Management like login,logout etc.
<table>
<tr bgcolor="#D3D3D3"><th>MASUser Singleton instance</th></tr>
<tr><td><i> MASPlugin.MASUser.currentUser(successHandler(theUser),errorHandler(error));</i>//theUser is the singleton here</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="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line7">line 7</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="active"><span class="type-signature"></span>active<span class="type-signature"> :boolean</span></h4>
<div class="description">
Checks if the user is active
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">boolean</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line89">line 89</a>
</li></ul></dd>
</dl>
<h4 class="name" id="addresses"><span class="type-signature"></span>addresses<span class="type-signature"> :array</span></h4>
<div class="description">
List of the addresses of the user
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">array</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line65">line 65</a>
</li></ul></dd>
</dl>
<h4 class="name" id="emailAddresses"><span class="type-signature"></span>emailAddresses<span class="type-signature"> :array</span></h4>
<div class="description">
List of the email addresses of the user
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">array</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line49">line 49</a>
</li></ul></dd>
</dl>
<h4 class="name" id="familyName"><span class="type-signature"></span>familyName<span class="type-signature"> :string</span></h4>
<div class="description">
The family name of the user
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line25">line 25</a>
</li></ul></dd>
</dl>
<h4 class="name" id="formattedName"><span class="type-signature"></span>formattedName<span class="type-signature"> :string</span></h4>
<div class="description">
The formatted name of the user
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line41">line 41</a>
</li></ul></dd>
</dl>
<h4 class="name" id="givenName"><span class="type-signature"></span>givenName<span class="type-signature"> :string</span></h4>
<div class="description">
The given name of the user
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line33">line 33</a>
</li></ul></dd>
</dl>
<h4 class="name" id="groups"><span class="type-signature"></span>groups<span class="type-signature"> :array</span></h4>
<div class="description">
List of the groups the user is a part of
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">array</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line81">line 81</a>
</li></ul></dd>
</dl>
<h4 class="name" id="phoneNumbers"><span class="type-signature"></span>phoneNumbers<span class="type-signature"> :array</span></h4>
<div class="description">
List of the phone numbers of the user
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">array</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line57">line 57</a>
</li></ul></dd>
</dl>
<h4 class="name" id="photos"><span class="type-signature"></span>photos<span class="type-signature"> :string</span></h4>
<div class="description">
Returns the base64 string of the user's photo
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line73">line 73</a>
</li></ul></dd>
</dl>
<h4 class="name" id="userName"><span class="type-signature"></span>userName<span class="type-signature"> :string</span></h4>
<div class="description">
The username of the user
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line17">line 17</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".currentUser"><span class="type-signature">(static) </span>currentUser<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
The authenticated user for the application, if any. Returns null if no authenticated user found.. This is a singleton object. <b>Developers should call this API first in order to use the instance attributes or functions
of the MASUser object.</b>
</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="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line259">line 259</a>
</li></ul></dd>
</dl>
<h5>Example</h5>
<p class="code-caption">For instance, to access the username field of the logged in user (and to see if the session is locked) you must call this API as follows</p>
<pre class="prettyprint"><code>MASPluginUser.currentUser(
function(result) {
// Get username of the user
var username = result.userName;
// Get Session Locked state
result.isSessionLocked(
function(success){
var isSessionLocked = success;
},function(error){});
},function(error) {}
);</code></pre>
<h4 class="name" id=".initializeBrowserBasedAuthentication"><span class="type-signature">(static) </span>initializeBrowserBasedAuthentication<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Authenticates a user by launching a Browser which in turn loads a URL (templatized). The URL needed is retrieved from the server endpoint mentioned in the configuration file.
</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="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line380">line 380</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".loginWithAuthCode"><span class="type-signature">(static) </span>loginWithAuthCode<span class="signature">(successHandler, errorHandler, authCode, state)</span><span class="type-signature"></span></h4>
<div class="description">
Authenticates a user asynchronously using an authorization code and a state(optional) variable
</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>authCode</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The Authorization code as received from an OAuth server.</td>
</tr>
<tr>
<td class="name"><code>state</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">A state variable for supporting the PKCE validation.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line313">line 313</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".loginWithAuthCredentialsAuthCode"><span class="type-signature">(static) </span>loginWithAuthCredentialsAuthCode<span class="signature">(successHandler, errorHandler, authorizationCode, state)</span><span class="type-signature"></span></h4>
<div class="description">
Authenticates a user asynchronously using the MAS native AuthCredential construct containing an authorization code and a state(optional) variable
</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>authorizationCode</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The Authorization code as received from an OAuth server.</td>
</tr>
<tr>
<td class="name"><code>state</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">A state variable for supporting the PKCE validation.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line364">line 364</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".loginWithAuthCredentialsJWT"><span class="type-signature">(static) </span>loginWithAuthCredentialsJWT<span class="signature">(successHandler, errorHandler, jwt, tokenType)</span><span class="type-signature"></span></h4>
<div class="description">
Authenticates a user asynchronously using the MAS native AuthCredential construct containing a JWT(id_token) and a token type
</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>jwt</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The id_token for the user. Ensure that the id_token is a valid JWT</td>
</tr>
<tr>
<td class="name"><code>tokenType</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Token type of id_token. <table><tr bgcolor="#D3D3D3"><th>Example</th></tr><tr><td>{`urn:ietf:params:oauth:grant-type:jwt-bearer`}</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="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line347">line 347</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".loginWithAuthCredentialsUsernamePassword"><span class="type-signature">(static) </span>loginWithAuthCredentialsUsernamePassword<span class="signature">(successHandler, errorHandler, userName, password)</span><span class="type-signature"></span></h4>
<div class="description">
Authenticates the user asynchronously using the MAS native AuthCredential construct that contains username and password.
</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="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line330">line 330</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".loginWithIdTokenAndTokenType"><span class="type-signature">(static) </span>loginWithIdTokenAndTokenType<span class="signature">(successHandler, errorHandler, idToken, tokenType)</span><span class="type-signature"></span></h4>
<div class="description">
Authenticates a user asynchronously using and id_token
</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>idToken</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The id_token for the user. Ensure that the id_token is a valid JWT</td>
</tr>
<tr>
<td class="name"><code>tokenType</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Token type of id_token. <table><tr bgcolor="#D3D3D3"><th>Example</th></tr><tr><td>{`urn:ietf:params:oauth:grant-type:jwt-bearer`}</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="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line296">line 296</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".loginWithUsernameAndPassword"><span class="type-signature">(static) </span>loginWithUsernameAndPassword<span class="signature">(successHandler, errorHandler, userName, password)</span><span class="type-signature"></span></h4>
<div class="description">
Authenticates the user asynchronously using the username and password.
</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="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line279">line 279</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getAccessToken"><span class="type-signature"></span>getAccessToken<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
String accessToken value of the current logged in 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>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line121">line 121</a>
</li></ul></dd>
</dl>
<h4 class="name" id="isAuthenticated"><span class="type-signature"></span>isAuthenticated<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Boolean indicator that specifies whether the MASPluginUser object is authenticated
</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="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line109">line 109</a>
</li></ul></dd>
</dl>
<h4 class="name" id="isCurrentUser"><span class="type-signature"></span>isCurrentUser<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Boolean indicator that specifies whether the MASPluginUser object is the current 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>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line97">line 97</a>
</li></ul></dd>
</dl>
<h4 class="name" id="isSessionLocked"><span class="type-signature"></span>isSessionLocked<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Boolean indicator that specifies whether the currently authenticated MASPluginUser object has the session locked.
</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="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line145">line 145</a>
</li></ul></dd>
</dl>
<h4 class="name" id="listAttributes"><span class="type-signature"></span>listAttributes<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Lists all the attributes of the Current logged in user. The attributes are in the form of a JSON with key:value pairs.
</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="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line133">line 133</a>
</li></ul></dd>
</dl>
<h4 class="name" id="lockSession"><span class="type-signature"></span>lockSession<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Locks the current session of the user. The user must log in to use 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>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line157">line 157</a>
</li></ul></dd>
</dl>
<h4 class="name" id="logout"><span class="type-signature"></span>logout<span class="signature">(successHandler, errorHandler, force)</span><span class="type-signature"></span></h4>
<div class="description">
Logs off the user from this app (In case of SSO the user is logged off from other apps too).
</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>force</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">The behavior for different values of force would be<br>
<table>
<tr bgcolor="#D3D3D3"><th>Value</th><th>Description</th>
<tr><td>true</td><td>The SDK clears local tokens regardless if the logout call to the server is successful or not.</td>
<tr><td>false</td><td>The SDK clears local tokens only if the logout call to the server is successful.</td></tr>
</table>
If no value is provided, then the default value `false` is used. This is for backward compatibility with old logout signature.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line206">line 206</a>
</li></ul></dd>
</dl>
<h4 class="name" id="removeSessionLock"><span class="type-signature"></span>removeSessionLock<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Removes the session lock for the user. Remove session causes all the stored tokens in the device to be wiped-out. The user must log in to use 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>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line194">line 194</a>
</li></ul></dd>
</dl>
<h4 class="name" id="unlockSession"><span class="type-signature"></span>unlockSession<span class="signature">(successHandler, errorHandler)</span><span class="type-signature"></span></h4>
<div class="description">
Unlocks the current session of the user. The user must log in to use 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>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUser.js.html">MASPluginUser.js</a>, <a href="MASPluginUser.js.html#line169">line 169</a>
</li></ul></dd>
</dl>
<h4 class="name" id="unlockSessionWithMessage"><span class="type-signature"></span>unlockSessionWithMessage<span class="signature">(successHandler, errorHandler, message)</span><span class="type-signature"></span></h4>
<div class="description">
Unlocks the current session of the user with a customizable message while unlocking. The user must log in to use 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="t