Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting getSSOData timeout to 5s #602

Merged
merged 2 commits into from
Dec 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Authentication.html
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ <h5>Parameters:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Thu Dec 07 2017 22:32:53 GMT-0200 (-02) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Tue Dec 26 2017 16:09:39 GMT-0200 (-02) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/Management.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ <h5>Parameters:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Thu Dec 07 2017 22:32:53 GMT-0200 (-02) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Tue Dec 26 2017 16:09:39 GMT-0200 (-02) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/WebAuth.html
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ <h5>Parameters:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Thu Dec 07 2017 22:32:53 GMT-0200 (-02) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Tue Dec 26 2017 16:09:39 GMT-0200 (-02) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/authentication_db-connection.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ <h1 class="page-title">authentication/db-connection.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Thu Dec 07 2017 22:32:53 GMT-0200 (-02) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Tue Dec 26 2017 16:09:39 GMT-0200 (-02) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
7 changes: 4 additions & 3 deletions docs/authentication_index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,8 @@ <h1 class="page-title">authentication/index.js</h1>
{
responseType: 'token id_token',
scope: 'openid profile email',
connection: ssodataInformation.lastUsedConnection
connection: ssodataInformation.lastUsedConnection,
timeout: 5000
},
function(err, result) {
if (err) {
Expand All @@ -431,7 +432,7 @@ <h1 class="page-title">authentication/index.js</h1>
name: ssodataInformation.lastUsedConnection
},
lastUsedUserID: result.idTokenPayload.sub,
lastUsedUsername: result.idTokenPayload.name || result.idTokenPayload.email,
lastUsedUsername: result.idTokenPayload.email || result.idTokenPayload.name,
lastUsedClientID: clientId,
sessionClients: [clientId],
sso: true
Expand Down Expand Up @@ -541,7 +542,7 @@ <h1 class="page-title">authentication/index.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Thu Dec 07 2017 22:32:53 GMT-0200 (-02) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Tue Dec 26 2017 16:09:39 GMT-0200 (-02) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
40 changes: 20 additions & 20 deletions docs/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ <h4 class="name" id="authorize"><span class="type-signature"></span>authorize<sp

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line460">line 460</a>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line461">line 461</a>
</li></ul></dd>


Expand Down Expand Up @@ -2332,7 +2332,7 @@ <h4 class="name" id="changePassword"><span class="type-signature"></span>changeP

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line399">line 399</a>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line400">line 400</a>
</li></ul></dd>


Expand Down Expand Up @@ -2822,7 +2822,7 @@ <h4 class="name" id="checkSession"><span class="type-signature"></span>checkSess

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line360">line 360</a>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line361">line 361</a>
</li></ul></dd>


Expand Down Expand Up @@ -3274,7 +3274,7 @@ <h4 class="name" id="crossOriginAuthenticationCallback"><span class="type-signat

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line585">line 585</a>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line586">line 586</a>
</li></ul></dd>


Expand Down Expand Up @@ -3357,7 +3357,7 @@ <h4 class="name" id="crossOriginVerification"><span class="type-signature"></spa

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line595">line 595</a>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line596">line 596</a>
</li></ul></dd>


Expand Down Expand Up @@ -3440,7 +3440,7 @@ <h4 class="name" id="delegation"><span class="type-signature"></span>delegation<

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line436">line 436</a>
<a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line437">line 437</a>
</li></ul></dd>


Expand Down Expand Up @@ -4741,7 +4741,7 @@ <h4 class="name" id="login"><span class="type-signature"></span>login<span class

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line560">line 560</a>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line561">line 561</a>
</li></ul></dd>


Expand Down Expand Up @@ -5071,7 +5071,7 @@ <h4 class="name" id="login"><span class="type-signature"></span>login<span class

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line543">line 543</a>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line544">line 544</a>
</li></ul></dd>


Expand Down Expand Up @@ -7143,7 +7143,7 @@ <h4 class="name" id="logout"><span class="type-signature"></span>logout<span cla

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line604">line 604</a>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line605">line 605</a>
</li></ul></dd>


Expand Down Expand Up @@ -7717,7 +7717,7 @@ <h4 class="name" id="passwordlessStart"><span class="type-signature"></span>pass

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line413">line 413</a>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line414">line 414</a>
</li></ul></dd>


Expand Down Expand Up @@ -8088,7 +8088,7 @@ <h4 class="name" id="passwordlessVerify"><span class="type-signature"></span>pas

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line623">line 623</a>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line624">line 624</a>
</li></ul></dd>


Expand Down Expand Up @@ -9051,7 +9051,7 @@ <h4 class="name" id="renewAuth"><span class="type-signature"></span>renewAuth<sp

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line283">line 283</a>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line284">line 284</a>
</li></ul></dd>


Expand Down Expand Up @@ -10021,7 +10021,7 @@ <h4 class="name" id="signup"><span class="type-signature"></span>signup<span cla

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line445">line 445</a>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line446">line 446</a>
</li></ul></dd>


Expand Down Expand Up @@ -10293,7 +10293,7 @@ <h4 class="name" id="signupAndAuthorize"><span class="type-signature"></span>sig

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line507">line 507</a>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line508">line 508</a>
</li></ul></dd>


Expand Down Expand Up @@ -11096,7 +11096,7 @@ <h4 class="name" id="userInfo"><span class="type-signature"></span>userInfo<span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line408">line 408</a>
<a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line409">line 409</a>
</li></ul></dd>


Expand Down Expand Up @@ -12056,7 +12056,7 @@ <h4 class="name" id="crossOriginLoginCallback"><span class="type-signature"></sp

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line538">line 538</a>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line539">line 539</a>
</li></ul></dd>


Expand Down Expand Up @@ -12199,7 +12199,7 @@ <h4 class="name" id="delegationCallback"><span class="type-signature"></span>del

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line430">line 430</a>
<a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line431">line 431</a>
</li></ul></dd>


Expand Down Expand Up @@ -13159,7 +13159,7 @@ <h4 class="name" id="userInfoCallback"><span class="type-signature"></span>userI

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line402">line 402</a>
<a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line403">line 403</a>
</li></ul></dd>


Expand Down Expand Up @@ -13338,7 +13338,7 @@ <h4 class="name" id="validateTokenCallback"><span class="type-signature"></span>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line251">line 251</a>
<a href="web-auth_index.js.html">web-auth/index.js</a>, <a href="web-auth_index.js.html#line252">line 252</a>
</li></ul></dd>


Expand Down Expand Up @@ -13488,7 +13488,7 @@ <h5>Parameters:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Thu Dec 07 2017 22:32:53 GMT-0200 (-02) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Tue Dec 26 2017 16:09:39 GMT-0200 (-02) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
8 changes: 5 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ <h1>auth0.js</h1><p><a href="https://circleci.com/gh/auth0/auth0.js"><img src="h
<a href="https://npmjs.org/package/auth0-js"><img src="http://img.shields.io/npm/dm/auth0-js.svg?style=flat-square" alt="Downloads"></a></p>
<p>Client Side Javascript toolkit for Auth0 API</p>
<blockquote>
<p>This is a BETA release. The recommended version is <a href="https://auth0.com/docs/libraries/auth0js/v8">https://auth0.com/docs/libraries/auth0js/v8</a></p>
<p>Auth0.js v9 uses our latest embedded login API. This version <strong>is not supported in centralized login scenarios (i.e. Hosted Login Pages).</strong> If you are using a Hosted Login Page, keep using Auth0.js v8.</p>
</blockquote>
<p>Need help migrating from v8? Please check our <a href="https://auth0.com/docs/libraries/auth0js/v9/migration-guide">Migration Guide</a></p>
<p>If you want to read the full API documentation of auth0.js, see <a href="https://auth0.github.io/auth0.js/index.html">here</a></p>
<h2>Install</h2><p>From CDN</p>
<pre class="prettyprint source lang-html"><code>&lt;!-- Latest patch release -->
&lt;script src=&quot;http://cdn.auth0.com/js/auth0/9.0.0/auth0.min.js&quot;>&lt;/script></code></pre><p>From <a href="https://npmjs.org">npm</a></p>
Expand Down Expand Up @@ -107,7 +109,7 @@ <h3>API</h3><ul>
// Now you have the user's information
});
});</code></pre><ul>
<li><strong>checkSession(options, callback)</strong>: Allows you to acquire a new token from Auth0 for a user who is already authenticated against the hosted login page for your domain. If the user is not authenticated, the authentication result will be empty and you'll receive an error like this: <code>{error: 'login_required'}</code>.The method accepts any valid OAuth2 parameters that would normally be sent to <code>/authorize</code>.
<li><strong>checkSession(options, callback)</strong>: Allows you to acquire a new token from Auth0 for a user who already has an SSO session established against Auth0 for your domain. If the user is not authenticated, the authentication result will be empty and you'll receive an error like this: <code>{error: 'login_required'}</code>.The method accepts any valid OAuth2 parameters that would normally be sent to <code>/authorize</code>.
Everything happens inside an iframe, so it will not reload your application or redirect away from it.</li>
</ul>
<pre class="prettyprint source lang-js"><code>auth0.checkSession({
Expand Down Expand Up @@ -176,7 +178,7 @@ <h2>License</h2><p>This project is licensed under the MIT license. See the <a hr
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Thu Dec 07 2017 22:32:53 GMT-0200 (-02) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Tue Dec 26 2017 16:09:39 GMT-0200 (-02) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/management_index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ <h1 class="page-title">management/index.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Thu Dec 07 2017 22:32:53 GMT-0200 (-02) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Tue Dec 26 2017 16:09:39 GMT-0200 (-02) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/web-auth_cross-origin-authentication.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ <h1 class="page-title">web-auth/cross-origin-authentication.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Thu Dec 07 2017 22:32:53 GMT-0200 (-02) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Tue Dec 26 2017 16:09:39 GMT-0200 (-02) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
7 changes: 4 additions & 3 deletions docs/web-auth_index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ <h1 class="page-title">web-auth/index.js</h1>
var _this = this;
var state = parsedHash.state;
var transaction = this.transactionManager.getStoredTransaction(state);
var transactionStateMatchesState = transaction &amp;&amp; transaction.state === state;
var transactionState = options.state || (transaction &amp;&amp; transaction.state) || null;
var transactionStateMatchesState = transactionState === state;
if (state &amp;&amp; !transactionStateMatchesState) {
return cb({
error: 'invalid_token',
Expand All @@ -229,7 +230,7 @@ <h1 class="page-title">web-auth/index.js</h1>
}
var transactionNonce = options.nonce || (transaction &amp;&amp; transaction.nonce) || null;

var appState = (transaction &amp;&amp; transaction.appState) || null;
var appState = options.state || (transaction &amp;&amp; transaction.appState) || null;

var callback = function(err, payload) {
if (err) {
Expand Down Expand Up @@ -720,7 +721,7 @@ <h1 class="page-title">web-auth/index.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Thu Dec 07 2017 22:32:53 GMT-0200 (-02) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Tue Dec 26 2017 16:09:39 GMT-0200 (-02) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/web-auth_popup.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ <h1 class="page-title">web-auth/popup.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Thu Dec 07 2017 22:32:53 GMT-0200 (-02) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Tue Dec 26 2017 16:09:39 GMT-0200 (-02) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/web-auth_redirect.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ <h1 class="page-title">web-auth/redirect.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Thu Dec 07 2017 22:32:53 GMT-0200 (-02) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.0</a> on Tue Dec 26 2017 16:09:39 GMT-0200 (-02) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
3 changes: 2 additions & 1 deletion src/authentication/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ Authentication.prototype.getSSOData = function(withActiveDirectories, cb) {
{
responseType: 'token id_token',
scope: 'openid profile email',
connection: ssodataInformation.lastUsedConnection
connection: ssodataInformation.lastUsedConnection,
timeout: 5000
},
function(err, result) {
if (err) {
Expand Down
3 changes: 2 additions & 1 deletion test/authentication/authentication.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ describe('auth0.authentication', function() {
expect(this.webAuthSpy.checkSession.lastCall.args[0]).to.be.eql({
responseType: 'token id_token',
scope: 'openid profile email',
connection: 'lastUsedConnection'
connection: 'lastUsedConnection',
timeout: 5000
});
});
it('returns sso:false if checkSession fails', function(done) {
Expand Down