stormpath-js
Advanced tools
Comparing version 0.5.2 to 0.7.1
{ | ||
"name": "stormpath.js", | ||
"description": "A browser-ready javascript library for Stormpath", | ||
"version": "0.5.2", | ||
"version": "0.7.1", | ||
"license": "Apache 2.0", | ||
@@ -6,0 +6,0 @@ "main": "dist/stormpath.js", |
@@ -0,1 +1,52 @@ | ||
## 0.7.1 | ||
The internal request executor will now return the SESSION_EXPIRED error on next | ||
tick, to integrate well with Angular's digest process. | ||
## 0.7.0 | ||
* Registration attempts now post to the Organization, if an Organization is | ||
specified when the user is redirected to ID Site. Previously they were posted | ||
to the Application's endpoint. | ||
**Known Bug**: In this version, the end user cannot recover from the duplicate | ||
account error. This is an issue with the Stormpath REST API and a fix will be | ||
released soon. | ||
* This version also properly surfaces 403 errors from the Stormpath REST API. | ||
## 0.6.2 | ||
* Fixed a problem in the client constructor that would cause an exception in | ||
`getJwtFromUrl()`. The error occurred because we were expecting all application | ||
URLs to be on api.stormpath.com. This was preventing Enterprise and Private | ||
Deployment tenants from using the 0.6.x series. | ||
## 0.6.1 | ||
* Reverted the changes from 0.5.2, that used `getResponseHeader()` instead of | ||
`getAllResponseHeaders()`. This caused "Refused to get unsafe header" errors to | ||
be logged. These errors did not break application behavior, but did introduce | ||
a source of confusion. This revert means that Firefox < 22 will not be | ||
compatible with this library. | ||
* This library now uses the [Buffer module](https://github.com/feross/buffer) | ||
for Base64-URL decoding, and should be more robust with JWTs that contain | ||
Unicode characters and string-encoded JSON values. | ||
* Fixed a bug with the password reset flow that was introduced by 0.6.0. When | ||
arriving on the #/reset?jwt=<jwt> URL, you would be directed to #/ and not shown | ||
the reset password form. | ||
## 0.6.0 | ||
The Id Site Request Executor will now pull the initial JWT from the URL and | ||
store it in a cookie. Subsequent JWTs, obtained during API interaction, will be | ||
stored in the cookie. This allows the end-user to reload the page without | ||
breaking the authenticated session. | ||
If using this library with Angular, you should use Angular >= 1.2.29, as | ||
previous versions may have a digest error when stormpath.js removes the JWT from | ||
the window location. | ||
## 0.5.2 | ||
@@ -15,2 +66,37 @@ | ||
Support Organization features by requesting the ID Site Model from the provided | ||
account store. | ||
account store. | ||
## 0.4.0 | ||
**Released on October 23rd, 2015** | ||
* Refactoring the internal request executor to supply contextual error messages | ||
* Fixing https://github.com/stormpath/idsite-src/issues/2 by not sending cookies | ||
on requests to the API | ||
**Breaking Changes** | ||
* `client._getToken()` has been renamed to `client.getJwtFromUrl()` | ||
* The value `response.redirectUrl` has been renamed to `response.serviceProviderCallbackUrl`. This affects the callbacks for `client.login()` and `client.register()` | ||
## 0.3.1 | ||
Fixing the base64 encoding strategy, unicode characters are now supported. | ||
## 0.3.0 | ||
Adding support for Organizations | ||
## 0.2.0 | ||
Support for Single-Sign-On (SSO) | ||
## 0.1.0 | ||
First release! This release includes all the methods that you need to | ||
build your own ID Site |
@@ -66,4 +66,2 @@ # Contributing | ||
Please make all pull requests into the `development` branch, not `master`. | ||
### Making releases | ||
@@ -70,0 +68,0 @@ |
/* | ||
Stormpath.js v0.5.2 | ||
Stormpath.js v0.7.1 | ||
(c) 2014-2016 Stormpath, Inc. http://stormpath.com | ||
License: Apache 2.0 | ||
*/ | ||
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.Stormpath=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";function d(a,b){var c="object"==typeof a?a:{},d="function"==typeof a?a:b||h.noop,j=this,k=null;if(j.jwt=c.token||j.getJwtFromUrl(),!j.jwt)return e(d,[new Error(g.errors.JWT_NOT_FOUND)]);if(k=j.jwt.split("."),k.length<2||k.length>3)return e(d,[new Error(g.errors.NOT_A_JWT)]);try{j.jwtPayload=JSON.parse(i.atob(k[1]))}catch(l){return e(d,[new Error(g.errors.MALFORMED_JWT_CLAIMS)])}j.appHref=j.jwtPayload.app_href,j.sptoken=j.jwtPayload.sp_token||null,j.baseurl=j.appHref.match("^.+//([^/]+)/")[0];var m=j.appHref;j.jwtPayload.onk&&j.setCachedOrganizationNameKey(j.jwtPayload.onk),j.jwtPayload.asnk&&(m=j.jwtPayload.ash),j.requestExecutor=c.requestExecutor||new f(j.jwt),j.requestExecutor.execute({method:"GET",url:m+"?expand=idSiteModel",json:!0},function(a,b){return a?d(401===a.status?new Error(g.errors.INITIAL_JWT_REJECTED):a):j.requestExecutor.authToken?void d(null,b.idSiteModel):d(new Error(g.errors.NO_AUTH_TOKEN_HEADER))})}var e=a("./defer-callback"),f=a("./idsite-request-executor"),g=a("./strings"),h=a("./utils"),i=h.base64;d.prototype.organizationNameKeyCookieKey="sp.onk",d.prototype.organizationNameKeyCookieExpiration="expires=Fri, 31 Dec 9999 23:59:59 GMT",d.prototype.getCachedOrganizationNameKey=function(){return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(this.organizationNameKeyCookieKey).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},d.prototype.setCachedOrganizationNameKey=function(a){document.cookie=encodeURIComponent(this.organizationNameKeyCookieKey)+"="+encodeURIComponent(a)+"; "+this.organizationNameKeyCookieExpiration},d.prototype.getJwtFromUrl=function(){return decodeURIComponent((window.location.href.match(/jwt=([^&]+)/)||[])[1]||"")},d.prototype.login=function(a,b){var c,d=this,e="object"==typeof a?a:null;if(!e)throw new Error("must provide an object");if(e.providerData)c=e;else{if(!e.login)throw new Error("unsupported credentials object");c={type:"basic",value:h.base64.btoa(e.login+":"+e.password)}}e.accountStore&&(c.accountStore=e.accountStore),d.requestExecutor.execute({method:"POST",url:d.appHref+"/loginAttempts",json:c},b||h.noop)},d.prototype.register=function(a,b){if("object"!=typeof a)throw new Error("client.register() must be called with a data object");var c=this;c.requestExecutor.execute({method:"POST",url:c.appHref+"/accounts",json:a},b||h.noop)},d.prototype.verifyEmailToken=function(a){var b=this;if("function"!=typeof a)throw new Error("client.verifyEmailToken() takes a function as it's only argument");b.requestExecutor.execute({method:"POST",url:b.baseurl+"/v1/accounts/emailVerificationTokens/"+b.sptoken},a)},d.prototype.verifyPasswordResetToken=function(a){var b=this;if("function"!=typeof a)throw new Error("client.verifyPasswordResetToken() takes a function as it's only argument");b.requestExecutor.execute({method:"GET",url:b.appHref+"/passwordResetTokens/"+b.sptoken,json:!0},a)},d.prototype.setAccountPassword=function(a,b,c){var d=this;if(!a||!a.href)throw new Error("invalid passwordVerificationTokenResource");if(!b)throw new Error("must supply new password as second argument to client.setAccountPassword()");d.requestExecutor.execute({method:"POST",url:a.href,json:{password:b}},c||h.noop)},d.prototype.sendPasswordResetEmail=function(a,b){var c,d=this;if("string"==typeof a)c={email:a};else{if("object"!=typeof a)throw new Error("sendPasswordResetEmail must be called with an email/username as the first argument, or an options object");c=a}d.requestExecutor.execute({method:"POST",url:d.appHref+"/passwordResetTokens",json:c},b||h.noop)},b.exports=d},{"./defer-callback":2,"./idsite-request-executor":3,"./strings":5,"./utils":6}],2:[function(a,b,c){"use strict";function d(a,b){setTimeout(function(){a.apply(null,b)},0)}b.exports=d},{}],3:[function(a,b,c){"use strict";function d(a){this.authToken=a}var e=a("xhr"),f=a("./strings.json");d.prototype.handleResponse=function(a,b,c,d){var e=this,g=b.headers.authorization||b.rawRequest.getResponseHeader&&b.rawRequest.getResponseHeader("Authorization"),h=null,i=b.headers["stormpath-sso-redirect-location"]||b.rawRequest.getResponseHeader&&b.rawRequest.getResponseHeader("stormpath-sso-redirect-location");if(g){if(h=g.split("Bearer"),2!==h.length)return d(new Error(f.errors.INVALID_AUTH_TOKEN_HEADER));e.authToken=h[1].trim()}else e.authToken=null;return a?d(a):b.statusCode>399?(i&&(c.serviceProviderCallbackUrl=i),d(c)):i?d(null,{serviceProviderCallbackUrl:i}):void d(null,c)},d.prototype.execute=function(a,b){var c=this;if("object"!=typeof a)throw new Error("Must provide xhrRequestOptions as first parameter");if("function"!=typeof b)throw new Error("Must provide callback as second parameter");return a.headers||(a.headers={}),c.authToken?(a.headers.Authorization="Bearer "+c.authToken,e(a,function(a,d,e){c.handleResponse(a,d,e,b)})):b(new Error(f.errors.NO_AUTH_TOKEN))},b.exports=d},{"./strings.json":5,xhr:7}],4:[function(a,b,c){b.exports={Client:a("./client")}},{"./client":1}],5:[function(a,b,c){b.exports={errors:{JWT_NOT_FOUND:"JWT not found as url query parameter.",NOT_A_JWT:"JWT does not appear to be a property formatted JWT.",MALFORMED_JWT_CLAIMS:"The JWT claims section is malfomed and could not be decoded as JSON.",NO_AUTH_TOKEN_HEADER:"HTTP response does not contain Authorization header.",INVALID_AUTH_TOKEN_HEADER:"HTTP response has an invalid Authorization header.",INITIAL_JWT_REJECTED:"The JWT used to initialized the client was rejected."}}},{}],6:[function(a,b,c){"use strict";function d(a){return btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,function(a,b){return String.fromCharCode("0x"+b)}))}b.exports={base64:{atob:function(a){return decodeURIComponent(window.atob(a))},btoa:function(a){var b=d(a);return b}},noop:function(){}}},{}],7:[function(a,b,c){"use strict";function d(a,b){for(var c=0;c<a.length;c++)b(a[c])}function e(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}function f(a,b,c){var d=a;return l(b)?(c=b,"string"==typeof a&&(d={uri:a})):d=n(b,{uri:a}),d.callback=c,d}function g(a,b,c){return b=f(a,b,c),h(b)}function h(a){function b(){4===j.readyState&&f()}function c(){var a=void 0;if(j.response?a=j.response:"text"!==j.responseType&&j.responseType||(a=j.responseText||j.responseXML),u)try{a=JSON.parse(a)}catch(b){}return a}function d(a){clearTimeout(o),a instanceof Error||(a=new Error(""+(a||"Unknown XMLHttpRequest Error"))),a.statusCode=0,h(a,i)}function f(){if(!n){var b;clearTimeout(o),b=a.useXDR&&void 0===j.status?200:1223===j.status?204:j.status;var d=i,e=null;0!==b?(d={body:c(),statusCode:b,method:q,headers:{},url:p,rawRequest:j},j.getAllResponseHeaders&&(d.headers=m(j.getAllResponseHeaders()))):e=new Error("Internal XMLHttpRequest Error"),h(e,d,d.body)}}var h=a.callback;if("undefined"==typeof h)throw new Error("callback argument missing");h=k(h);var i={body:void 0,headers:{},statusCode:0,method:q,url:p,rawRequest:j},j=a.xhr||null;j||(j=a.cors||a.useXDR?new g.XDomainRequest:new g.XMLHttpRequest);var l,n,o,p=j.url=a.uri||a.url,q=j.method=a.method||"GET",r=a.body||a.data||null,s=j.headers=a.headers||{},t=!!a.sync,u=!1;if("json"in a&&(u=!0,s.accept||s.Accept||(s.Accept="application/json"),"GET"!==q&&"HEAD"!==q&&(s["content-type"]||s["Content-Type"]||(s["Content-Type"]="application/json"),r=JSON.stringify(a.json))),j.onreadystatechange=b,j.onload=f,j.onerror=d,j.onprogress=function(){},j.ontimeout=d,j.open(q,p,!t,a.username,a.password),t||(j.withCredentials=!!a.withCredentials),!t&&a.timeout>0&&(o=setTimeout(function(){n=!0,j.abort("timeout");var a=new Error("XMLHttpRequest timeout");a.code="ETIMEDOUT",d(a)},a.timeout)),j.setRequestHeader)for(l in s)s.hasOwnProperty(l)&&j.setRequestHeader(l,s[l]);else if(a.headers&&!e(a.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in a&&(j.responseType=a.responseType),"beforeSend"in a&&"function"==typeof a.beforeSend&&a.beforeSend(j),j.send(r),j}function i(){}var j=a("global/window"),k=a("once"),l=a("is-function"),m=a("parse-headers"),n=a("xtend");b.exports=g,g.XMLHttpRequest=j.XMLHttpRequest||i,g.XDomainRequest="withCredentials"in new g.XMLHttpRequest?g.XMLHttpRequest:j.XDomainRequest,d(["get","put","post","patch","head","delete"],function(a){g["delete"===a?"del":a]=function(b,c,d){return c=f(b,c,d),c.method=a.toUpperCase(),h(c)}})},{"global/window":8,"is-function":9,once:10,"parse-headers":13,xtend:14}],8:[function(a,b,c){(function(a){"undefined"!=typeof window?b.exports=window:"undefined"!=typeof a?b.exports=a:"undefined"!=typeof self?b.exports=self:b.exports={}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],9:[function(a,b,c){function d(a){var b=e.call(a);return"[object Function]"===b||"function"==typeof a&&"[object RegExp]"!==b||"undefined"!=typeof window&&(a===window.setTimeout||a===window.alert||a===window.confirm||a===window.prompt)}b.exports=d;var e=Object.prototype.toString},{}],10:[function(a,b,c){function d(a){var b=!1;return function(){return b?void 0:(b=!0,a.apply(this,arguments))}}b.exports=d,d.proto=d(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return d(this)},configurable:!0})})},{}],11:[function(a,b,c){function d(a,b,c){if(!h(b))throw new TypeError("iterator must be a function");arguments.length<3&&(c=this),"[object Array]"===i.call(a)?e(a,b,c):"string"==typeof a?f(a,b,c):g(a,b,c)}function e(a,b,c){for(var d=0,e=a.length;e>d;d++)j.call(a,d)&&b.call(c,a[d],d,a)}function f(a,b,c){for(var d=0,e=a.length;e>d;d++)b.call(c,a.charAt(d),d,a)}function g(a,b,c){for(var d in a)j.call(a,d)&&b.call(c,a[d],d,a)}var h=a("is-function");b.exports=d;var i=Object.prototype.toString,j=Object.prototype.hasOwnProperty},{"is-function":9}],12:[function(a,b,c){function d(a){return a.replace(/^\s*|\s*$/g,"")}c=b.exports=d,c.left=function(a){return a.replace(/^\s*/,"")},c.right=function(a){return a.replace(/\s*$/,"")}},{}],13:[function(a,b,c){var d=a("trim"),e=a("for-each"),f=function(a){return"[object Array]"===Object.prototype.toString.call(a)};b.exports=function(a){if(!a)return{};var b={};return e(d(a).split("\n"),function(a){var c=a.indexOf(":"),e=d(a.slice(0,c)).toLowerCase(),g=d(a.slice(c+1));"undefined"==typeof b[e]?b[e]=g:f(b[e])?b[e].push(g):b[e]=[b[e],g]}),b}},{"for-each":11,trim:12}],14:[function(a,b,c){function d(){for(var a={},b=0;b<arguments.length;b++){var c=arguments[b];for(var d in c)e.call(c,d)&&(a[d]=c[d])}return a}b.exports=d;var e=Object.prototype.hasOwnProperty},{}]},{},[4])(4)}); | ||
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.Stormpath=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";function d(a,b){var c="object"==typeof a?a:{},d="function"==typeof a?a:b||h.noop,j=this,k=null;if(j.jwt=c.token||j.getJwtFromUrl(),!j.jwt)return e(d,[new Error(g.errors.JWT_NOT_FOUND)]);if(k=j.jwt.split("."),k.length<2||k.length>3)return e(d,[new Error(g.errors.NOT_A_JWT)]);try{j.jwtPayload=JSON.parse(i.atob(k[1]))}catch(l){return e(d,[new Error(g.errors.MALFORMED_JWT_CLAIMS)])}j.appHref=j.jwtPayload.app_href,j.sptoken=j.getPasswordResetToken(),j.baseurl=j.appHref.match("^.+//([^/]+)/")[0],j.idSiteParentResource=j.appHref,j.jwtPayload.onk&&j.setCachedOrganizationNameKey(j.jwtPayload.onk),j.jwtPayload.asnk&&(j.idSiteParentResource=j.jwtPayload.ash),j.requestExecutor=c.requestExecutor||new f(j.jwt),j.requestExecutor.execute({method:"GET",url:j.idSiteParentResource+"?expand=idSiteModel",json:!0},function(a,b){return a?d(401===a.status?new Error(g.errors.SESSION_EXPIRED):a):j.requestExecutor.authToken?(c.token||j.saveSessionToken(),void d(null,b.idSiteModel)):d(new Error(g.errors.NO_AUTH_TOKEN_HEADER))})}var e=a("./defer-callback"),f=a("./idsite-request-executor"),g=a("./strings"),h=a("./utils"),i=h.base64;d.prototype.organizationNameKeyCookieKey="sp.onk",d.prototype.organizationNameKeyCookieExpiration="expires=Fri, 31 Dec 9999 23:59:59 GMT",d.prototype.getCachedOrganizationNameKey=function(){return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(this.organizationNameKeyCookieKey).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},d.prototype.setCachedOrganizationNameKey=function(a){document.cookie=encodeURIComponent(this.organizationNameKeyCookieKey)+"="+encodeURIComponent(a)+"; "+this.organizationNameKeyCookieExpiration},d.prototype.getJwtFromUrl=function(){var a=window.location.href.match(/jwt=([^&]+)/),b=h.getCookie("idSiteJwt");return a?(window.location.replace((window.location+"").replace(/\?jwt=([^&]+)/,"")),decodeURIComponent(a[1])):b?(document.cookie="idSiteJwt=",b):""},d.prototype.saveSessionToken=function(){document.cookie="idSiteJwt="+this.requestExecutor.authToken},d.prototype.getPasswordResetToken=function(){var a=this;if(a.jwtPayload.sp_token)return a.jwtPayload.sp_token;var b=a.appHref.match(/[^\/]+$/)[0],c=a.jwtPayload.scope.application[b],d=c.map(function(a){return a.passwordResetToken}).reduce(function(a,b){return a||b}).map(function(a){return"object"==typeof a?a:null}).reduce(function(a,b){return a||b});return d?Object.keys(d)[0]:null},d.prototype.login=function(a,b){var c,d=this,e="object"==typeof a?a:null;if(!e)throw new Error("must provide an object");if(e.providerData)c=e;else{if(!e.login)throw new Error("unsupported credentials object");c={type:"basic",value:h.base64.btoa(e.login+":"+e.password)}}e.accountStore&&(c.accountStore=e.accountStore),d.requestExecutor.execute({method:"POST",url:d.appHref+"/loginAttempts",json:c},b||h.noop)},d.prototype.register=function(a,b){if("object"!=typeof a)throw new Error("client.register() must be called with a data object");var c=this;c.requestExecutor.execute({method:"POST",url:c.idSiteParentResource+"/accounts",json:a},b||h.noop)},d.prototype.verifyEmailToken=function(a){var b=this;if("function"!=typeof a)throw new Error("client.verifyEmailToken() takes a function as it's only argument");b.requestExecutor.execute({method:"POST",url:b.baseurl+"/v1/accounts/emailVerificationTokens/"+b.sptoken},a)},d.prototype.verifyPasswordResetToken=function(a){var b=this;if("function"!=typeof a)throw new Error("client.verifyPasswordResetToken() takes a function as it's only argument");b.requestExecutor.execute({method:"GET",url:b.appHref+"/passwordResetTokens/"+b.sptoken,json:!0},function(c,d){b.saveSessionToken(),a&&a(c,d)})},d.prototype.setAccountPassword=function(a,b,c){var d=this;if(!a||!a.href)throw new Error("invalid passwordVerificationTokenResource");if(!b)throw new Error("must supply new password as second argument to client.setAccountPassword()");d.requestExecutor.execute({method:"POST",url:a.href,json:{password:b}},c||h.noop)},d.prototype.sendPasswordResetEmail=function(a,b){var c,d=this;if("string"==typeof a)c={email:a};else{if("object"!=typeof a)throw new Error("sendPasswordResetEmail must be called with an email/username as the first argument, or an options object");c=a}d.requestExecutor.execute({method:"POST",url:d.appHref+"/passwordResetTokens",json:c},b||h.noop)},b.exports=d},{"./defer-callback":2,"./idsite-request-executor":3,"./strings":5,"./utils":6}],2:[function(a,b,c){"use strict";function d(a,b){setTimeout(function(){a.apply(null,b)},0)}b.exports=d},{}],3:[function(a,b,c){"use strict";function d(a){this.authToken=a}var e=a("xhr"),f=a("./strings.json");d.prototype.handleResponse=function(a,b,c,d){var e=this,g=b.headers.authorization,h=null,i=b.headers["stormpath-sso-redirect-location"];if(g){if(h=g.split("Bearer"),2!==h.length)return d(new Error(f.errors.INVALID_AUTH_TOKEN_HEADER));e.authToken=h[1].trim()}else e.authToken=null;return a?d(a):b.statusCode>399?(i&&(c.serviceProviderCallbackUrl=i),403!==b.statusCode||c||(c={status:403,message:"Forbidden"}),d(c)):i?d(null,{serviceProviderCallbackUrl:i}):void d(null,c)},d.prototype.execute=function(a,b){var c=this;if("object"!=typeof a)throw new Error("Must provide xhrRequestOptions as first parameter");if("function"!=typeof b)throw new Error("Must provide callback as second parameter");return a.headers||(a.headers={}),c.authToken?(a.headers.Authorization="Bearer "+c.authToken,e(a,function(a,d,e){c.handleResponse(a,d,e,b)})):setTimeout(b.bind(null,new Error(f.errors.SESSION_EXPIRED)),1)},b.exports=d},{"./strings.json":5,xhr:11}],4:[function(a,b,c){b.exports={Client:a("./client")}},{"./client":1}],5:[function(a,b,c){b.exports={errors:{JWT_NOT_FOUND:"Login session not initialized.",NOT_A_JWT:"JWT does not appear to be a property formatted JWT.",MALFORMED_JWT_CLAIMS:"The JWT claims section is malfomed and could not be decoded as JSON.",NO_AUTH_TOKEN_HEADER:"HTTP response does not contain Authorization header.",INVALID_AUTH_TOKEN_HEADER:"HTTP response has an invalid Authorization header.",INITIAL_JWT_REJECTED:"Your login session is expired.",SESSION_EXPIRED:"Your login session is expired."}}},{}],6:[function(a,b,c){"use strict";function d(a){return btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,function(a,b){return String.fromCharCode("0x"+b)}))}function e(a){var b=document.cookie.match(new RegExp(a+"=([^;]+)"));return b?b[1]:void 0}var f=a("buffer/").Buffer;b.exports={base64:{atob:function(a){return new f(a,"base64").toString()},btoa:function(a){var b=d(a);return b}},noop:function(){},getCookie:e}},{"buffer/":7}],7:[function(a,b,c){(function(b){"use strict";function d(){try{var a=new Uint8Array(1);return a.foo=function(){return 42},42===a.foo()&&"function"==typeof a.subarray&&0===a.subarray(1,1).byteLength}catch(b){return!1}}function e(){return g.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(a,b){if(e()<b)throw new RangeError("Invalid typed array length");return g.TYPED_ARRAY_SUPPORT?(a=new Uint8Array(b),a.__proto__=g.prototype):(null===a&&(a=new g(b)),a.length=b),a}function g(a,b,c){if(!(g.TYPED_ARRAY_SUPPORT||this instanceof g))return new g(a,b,c);if("number"==typeof a){if("string"==typeof b)throw new Error("If encoding is specified then the first argument must be a string");return k(this,a)}return h(this,a,b,c)}function h(a,b,c,d){if("number"==typeof b)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&b instanceof ArrayBuffer?n(a,b,c,d):"string"==typeof b?l(a,b,c):o(a,b)}function i(a){if("number"!=typeof a)throw new TypeError('"size" argument must be a number')}function j(a,b,c,d){return i(b),0>=b?f(a,b):void 0!==c?"string"==typeof d?f(a,b).fill(c,d):f(a,b).fill(c):f(a,b)}function k(a,b){if(i(b),a=f(a,0>b?0:0|p(b)),!g.TYPED_ARRAY_SUPPORT)for(var c=0;b>c;c++)a[c]=0;return a}function l(a,b,c){if(("string"!=typeof c||""===c)&&(c="utf8"),!g.isEncoding(c))throw new TypeError('"encoding" must be a valid string encoding');var d=0|r(b,c);return a=f(a,d),a.write(b,c),a}function m(a,b){var c=0|p(b.length);a=f(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function n(a,b,c,d){if(b.byteLength,0>c||b.byteLength<c)throw new RangeError("'offset' is out of bounds");if(b.byteLength<c+(d||0))throw new RangeError("'length' is out of bounds");return b=void 0===d?new Uint8Array(b,c):new Uint8Array(b,c,d),g.TYPED_ARRAY_SUPPORT?(a=b,a.__proto__=g.prototype):a=m(a,b),a}function o(a,b){if(g.isBuffer(b)){var c=0|p(b.length);return a=f(a,c),0===a.length?a:(b.copy(a,0,0,c),a)}if(b){if("undefined"!=typeof ArrayBuffer&&b.buffer instanceof ArrayBuffer||"length"in b)return"number"!=typeof b.length||X(b.length)?f(a,0):m(a,b);if("Buffer"===b.type&&$(b.data))return m(a,b.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function p(a){if(a>=e())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e().toString(16)+" bytes");return 0|a}function q(a){return+a!=a&&(a=0),g.alloc(+a)}function r(a,b){if(g.isBuffer(a))return a.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(a)||a instanceof ArrayBuffer))return a.byteLength;"string"!=typeof a&&(a=""+a);var c=a.length;if(0===c)return 0;for(var d=!1;;)switch(b){case"ascii":case"binary":case"raw":case"raws":return c;case"utf8":case"utf-8":case void 0:return S(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return V(a).length;default:if(d)return S(a).length;b=(""+b).toLowerCase(),d=!0}}function s(a,b,c){var d=!1;if((void 0===b||0>b)&&(b=0),b>this.length)return"";if((void 0===c||c>this.length)&&(c=this.length),0>=c)return"";if(c>>>=0,b>>>=0,b>=c)return"";for(a||(a="utf8");;)switch(a){case"hex":return G(this,b,c);case"utf8":case"utf-8":return C(this,b,c);case"ascii":return E(this,b,c);case"binary":return F(this,b,c);case"base64":return B(this,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}}function t(a,b,c){var d=a[b];a[b]=a[c],a[c]=d}function u(a,b,c,d){function e(a,b){return 1===f?a[b]:a.readUInt16BE(b*f)}var f=1,g=a.length,h=b.length;if(void 0!==d&&(d=String(d).toLowerCase(),"ucs2"===d||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(a.length<2||b.length<2)return-1;f=2,g/=2,h/=2,c/=2}for(var i=-1,j=0;g>c+j;j++)if(e(a,c+j)===e(b,-1===i?0:j-i)){if(-1===i&&(i=j),j-i+1===h)return(c+i)*f}else-1!==i&&(j-=j-i),i=-1;return-1}function v(a,b,c,d){c=Number(c)||0;var e=a.length-c;d?(d=Number(d),d>e&&(d=e)):d=e;var f=b.length;if(f%2!==0)throw new Error("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;d>g;g++){var h=parseInt(b.substr(2*g,2),16);if(isNaN(h))return g;a[c+g]=h}return g}function w(a,b,c,d){return W(S(b,a.length-c),a,c,d)}function x(a,b,c,d){return W(T(b),a,c,d)}function y(a,b,c,d){return x(a,b,c,d)}function z(a,b,c,d){return W(V(b),a,c,d)}function A(a,b,c,d){return W(U(b,a.length-c),a,c,d)}function B(a,b,c){return 0===b&&c===a.length?Y.fromByteArray(a):Y.fromByteArray(a.slice(b,c))}function C(a,b,c){c=Math.min(a.length,c);for(var d=[],e=b;c>e;){var f=a[e],g=null,h=f>239?4:f>223?3:f>191?2:1;if(c>=e+h){var i,j,k,l;switch(h){case 1:128>f&&(g=f);break;case 2:i=a[e+1],128===(192&i)&&(l=(31&f)<<6|63&i,l>127&&(g=l));break;case 3:i=a[e+1],j=a[e+2],128===(192&i)&&128===(192&j)&&(l=(15&f)<<12|(63&i)<<6|63&j,l>2047&&(55296>l||l>57343)&&(g=l));break;case 4:i=a[e+1],j=a[e+2],k=a[e+3],128===(192&i)&&128===(192&j)&&128===(192&k)&&(l=(15&f)<<18|(63&i)<<12|(63&j)<<6|63&k,l>65535&&1114112>l&&(g=l))}}null===g?(g=65533,h=1):g>65535&&(g-=65536,d.push(g>>>10&1023|55296),g=56320|1023&g),d.push(g),e+=h}return D(d)}function D(a){var b=a.length;if(_>=b)return String.fromCharCode.apply(String,a);for(var c="",d=0;b>d;)c+=String.fromCharCode.apply(String,a.slice(d,d+=_));return c}function E(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCharCode(127&a[e]);return d}function F(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCharCode(a[e]);return d}function G(a,b,c){var d=a.length;(!b||0>b)&&(b=0),(!c||0>c||c>d)&&(c=d);for(var e="",f=b;c>f;f++)e+=R(a[f]);return e}function H(a,b,c){for(var d=a.slice(b,c),e="",f=0;f<d.length;f+=2)e+=String.fromCharCode(d[f]+256*d[f+1]);return e}function I(a,b,c){if(a%1!==0||0>a)throw new RangeError("offset is not uint");if(a+b>c)throw new RangeError("Trying to access beyond buffer length")}function J(a,b,c,d,e,f){if(!g.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>e||f>b)throw new RangeError('"value" argument is out of bounds');if(c+d>a.length)throw new RangeError("Index out of range")}function K(a,b,c,d){0>b&&(b=65535+b+1);for(var e=0,f=Math.min(a.length-c,2);f>e;e++)a[c+e]=(b&255<<8*(d?e:1-e))>>>8*(d?e:1-e)}function L(a,b,c,d){0>b&&(b=4294967295+b+1);for(var e=0,f=Math.min(a.length-c,4);f>e;e++)a[c+e]=b>>>8*(d?e:3-e)&255}function M(a,b,c,d,e,f){if(c+d>a.length)throw new RangeError("Index out of range");if(0>c)throw new RangeError("Index out of range")}function N(a,b,c,d,e){return e||M(a,b,c,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(a,b,c,d,23,4),c+4}function O(a,b,c,d,e){return e||M(a,b,c,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(a,b,c,d,52,8),c+8}function P(a){if(a=Q(a).replace(aa,""),a.length<2)return"";for(;a.length%4!==0;)a+="=";return a}function Q(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function R(a){return 16>a?"0"+a.toString(16):a.toString(16)}function S(a,b){b=b||1/0;for(var c,d=a.length,e=null,f=[],g=0;d>g;g++){if(c=a.charCodeAt(g),c>55295&&57344>c){if(!e){if(c>56319){(b-=3)>-1&&f.push(239,191,189);continue}if(g+1===d){(b-=3)>-1&&f.push(239,191,189);continue}e=c;continue}if(56320>c){(b-=3)>-1&&f.push(239,191,189),e=c;continue}c=(e-55296<<10|c-56320)+65536}else e&&(b-=3)>-1&&f.push(239,191,189);if(e=null,128>c){if((b-=1)<0)break;f.push(c)}else if(2048>c){if((b-=2)<0)break;f.push(c>>6|192,63&c|128)}else if(65536>c){if((b-=3)<0)break;f.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(1114112>c))throw new Error("Invalid code point");if((b-=4)<0)break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return f}function T(a){for(var b=[],c=0;c<a.length;c++)b.push(255&a.charCodeAt(c));return b}function U(a,b){for(var c,d,e,f=[],g=0;g<a.length&&!((b-=2)<0);g++)c=a.charCodeAt(g),d=c>>8,e=c%256,f.push(e),f.push(d);return f}function V(a){return Y.toByteArray(P(a))}function W(a,b,c,d){for(var e=0;d>e&&!(e+c>=b.length||e>=a.length);e++)b[e+c]=a[e];return e}function X(a){return a!==a}var Y=a("base64-js"),Z=a("ieee754"),$=a("isarray");c.Buffer=g,c.SlowBuffer=q,c.INSPECT_MAX_BYTES=50,g.TYPED_ARRAY_SUPPORT=void 0!==b.TYPED_ARRAY_SUPPORT?b.TYPED_ARRAY_SUPPORT:d(),c.kMaxLength=e(),g.poolSize=8192,g._augment=function(a){return a.__proto__=g.prototype,a},g.from=function(a,b,c){return h(null,a,b,c)},g.TYPED_ARRAY_SUPPORT&&(g.prototype.__proto__=Uint8Array.prototype,g.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&g[Symbol.species]===g&&Object.defineProperty(g,Symbol.species,{value:null,configurable:!0})),g.alloc=function(a,b,c){return j(null,a,b,c)},g.allocUnsafe=function(a){return k(null,a)},g.allocUnsafeSlow=function(a){return k(null,a)},g.isBuffer=function(a){return!(null==a||!a._isBuffer)},g.compare=function(a,b){if(!g.isBuffer(a)||!g.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var c=a.length,d=b.length,e=0,f=Math.min(c,d);f>e;++e)if(a[e]!==b[e]){c=a[e],d=b[e];break}return d>c?-1:c>d?1:0},g.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},g.concat=function(a,b){if(!$(a))throw new TypeError('"list" argument must be an Array of Buffers');if(0===a.length)return g.alloc(0);var c;if(void 0===b)for(b=0,c=0;c<a.length;c++)b+=a[c].length;var d=g.allocUnsafe(b),e=0;for(c=0;c<a.length;c++){var f=a[c];if(!g.isBuffer(f))throw new TypeError('"list" argument must be an Array of Buffers');f.copy(d,e),e+=f.length}return d},g.byteLength=r,g.prototype._isBuffer=!0,g.prototype.swap16=function(){var a=this.length;if(a%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var b=0;a>b;b+=2)t(this,b,b+1);return this},g.prototype.swap32=function(){var a=this.length;if(a%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var b=0;a>b;b+=4)t(this,b,b+3),t(this,b+1,b+2);return this},g.prototype.toString=function(){var a=0|this.length;return 0===a?"":0===arguments.length?C(this,0,a):s.apply(this,arguments)},g.prototype.equals=function(a){if(!g.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:0===g.compare(this,a)},g.prototype.inspect=function(){var a="",b=c.INSPECT_MAX_BYTES;return this.length>0&&(a=this.toString("hex",0,b).match(/.{2}/g).join(" "),this.length>b&&(a+=" ... ")),"<Buffer "+a+">"},g.prototype.compare=function(a,b,c,d,e){if(!g.isBuffer(a))throw new TypeError("Argument must be a Buffer");if(void 0===b&&(b=0),void 0===c&&(c=a?a.length:0),void 0===d&&(d=0),void 0===e&&(e=this.length),0>b||c>a.length||0>d||e>this.length)throw new RangeError("out of range index");if(d>=e&&b>=c)return 0;if(d>=e)return-1;if(b>=c)return 1;if(b>>>=0,c>>>=0,d>>>=0,e>>>=0,this===a)return 0;for(var f=e-d,h=c-b,i=Math.min(f,h),j=this.slice(d,e),k=a.slice(b,c),l=0;i>l;++l)if(j[l]!==k[l]){f=j[l],h=k[l];break}return h>f?-1:f>h?1:0},g.prototype.indexOf=function(a,b,c){if("string"==typeof b?(c=b,b=0):b>2147483647?b=2147483647:-2147483648>b&&(b=-2147483648),b>>=0,0===this.length)return-1;if(b>=this.length)return-1;if(0>b&&(b=Math.max(this.length+b,0)),"string"==typeof a&&(a=g.from(a,c)),g.isBuffer(a))return 0===a.length?-1:u(this,a,b,c);if("number"==typeof a)return g.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,a,b):u(this,[a],b,c);throw new TypeError("val must be string, number or Buffer")},g.prototype.includes=function(a,b,c){return-1!==this.indexOf(a,b,c)},g.prototype.write=function(a,b,c,d){if(void 0===b)d="utf8",c=this.length,b=0;else if(void 0===c&&"string"==typeof b)d=b,c=this.length,b=0;else{if(!isFinite(b))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");b=0|b,isFinite(c)?(c=0|c,void 0===d&&(d="utf8")):(d=c,c=void 0)}var e=this.length-b;if((void 0===c||c>e)&&(c=e),a.length>0&&(0>c||0>b)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");d||(d="utf8");for(var f=!1;;)switch(d){case"hex":return v(this,a,b,c);case"utf8":case"utf-8":return w(this,a,b,c);case"ascii":return x(this,a,b,c);case"binary":return y(this,a,b,c);case"base64":return z(this,a,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,a,b,c);default:if(f)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),f=!0}},g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;g.prototype.slice=function(a,b){var c=this.length;a=~~a,b=void 0===b?c:~~b,0>a?(a+=c,0>a&&(a=0)):a>c&&(a=c),0>b?(b+=c,0>b&&(b=0)):b>c&&(b=c),a>b&&(b=a);var d;if(g.TYPED_ARRAY_SUPPORT)d=this.subarray(a,b),d.__proto__=g.prototype;else{var e=b-a;d=new g(e,void 0);for(var f=0;e>f;f++)d[f]=this[f+a]}return d},g.prototype.readUIntLE=function(a,b,c){a=0|a,b=0|b,c||I(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return d},g.prototype.readUIntBE=function(a,b,c){a=0|a,b=0|b,c||I(a,b,this.length);for(var d=this[a+--b],e=1;b>0&&(e*=256);)d+=this[a+--b]*e;return d},g.prototype.readUInt8=function(a,b){return b||I(a,1,this.length),this[a]},g.prototype.readUInt16LE=function(a,b){return b||I(a,2,this.length),this[a]|this[a+1]<<8},g.prototype.readUInt16BE=function(a,b){return b||I(a,2,this.length),this[a]<<8|this[a+1]},g.prototype.readUInt32LE=function(a,b){return b||I(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]},g.prototype.readUInt32BE=function(a,b){return b||I(a,4,this.length),16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])},g.prototype.readIntLE=function(a,b,c){a=0|a,b=0|b,c||I(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return e*=128,d>=e&&(d-=Math.pow(2,8*b)),d},g.prototype.readIntBE=function(a,b,c){a=0|a,b=0|b,c||I(a,b,this.length);for(var d=b,e=1,f=this[a+--d];d>0&&(e*=256);)f+=this[a+--d]*e;return e*=128,f>=e&&(f-=Math.pow(2,8*b)),f},g.prototype.readInt8=function(a,b){return b||I(a,1,this.length),128&this[a]?-1*(255-this[a]+1):this[a]},g.prototype.readInt16LE=function(a,b){b||I(a,2,this.length);var c=this[a]|this[a+1]<<8;return 32768&c?4294901760|c:c},g.prototype.readInt16BE=function(a,b){b||I(a,2,this.length);var c=this[a+1]|this[a]<<8;return 32768&c?4294901760|c:c},g.prototype.readInt32LE=function(a,b){return b||I(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},g.prototype.readInt32BE=function(a,b){return b||I(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},g.prototype.readFloatLE=function(a,b){return b||I(a,4,this.length),Z.read(this,a,!0,23,4)},g.prototype.readFloatBE=function(a,b){return b||I(a,4,this.length),Z.read(this,a,!1,23,4)},g.prototype.readDoubleLE=function(a,b){return b||I(a,8,this.length),Z.read(this,a,!0,52,8)},g.prototype.readDoubleBE=function(a,b){return b||I(a,8,this.length),Z.read(this,a,!1,52,8)},g.prototype.writeUIntLE=function(a,b,c,d){if(a=+a,b=0|b,c=0|c,!d){var e=Math.pow(2,8*c)-1;J(this,a,b,c,e,0)}var f=1,g=0;for(this[b]=255&a;++g<c&&(f*=256);)this[b+g]=a/f&255;return b+c},g.prototype.writeUIntBE=function(a,b,c,d){if(a=+a,b=0|b,c=0|c,!d){var e=Math.pow(2,8*c)-1;J(this,a,b,c,e,0)}var f=c-1,g=1;for(this[b+f]=255&a;--f>=0&&(g*=256);)this[b+f]=a/g&255;return b+c},g.prototype.writeUInt8=function(a,b,c){return a=+a,b=0|b,c||J(this,a,b,1,255,0),g.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),this[b]=255&a,b+1},g.prototype.writeUInt16LE=function(a,b,c){return a=+a,b=0|b,c||J(this,a,b,2,65535,0),g.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8):K(this,a,b,!0),b+2},g.prototype.writeUInt16BE=function(a,b,c){return a=+a,b=0|b,c||J(this,a,b,2,65535,0),g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=255&a):K(this,a,b,!1),b+2},g.prototype.writeUInt32LE=function(a,b,c){return a=+a,b=0|b,c||J(this,a,b,4,4294967295,0),g.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=255&a):L(this,a,b,!0),b+4},g.prototype.writeUInt32BE=function(a,b,c){return a=+a,b=0|b,c||J(this,a,b,4,4294967295,0),g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a):L(this,a,b,!1),b+4},g.prototype.writeIntLE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);J(this,a,b,c,e-1,-e)}var f=0,g=1,h=0;for(this[b]=255&a;++f<c&&(g*=256);)0>a&&0===h&&0!==this[b+f-1]&&(h=1),this[b+f]=(a/g>>0)-h&255;return b+c},g.prototype.writeIntBE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);J(this,a,b,c,e-1,-e)}var f=c-1,g=1,h=0;for(this[b+f]=255&a;--f>=0&&(g*=256);)0>a&&0===h&&0!==this[b+f+1]&&(h=1),this[b+f]=(a/g>>0)-h&255;return b+c},g.prototype.writeInt8=function(a,b,c){return a=+a,b=0|b,c||J(this,a,b,1,127,-128),g.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),0>a&&(a=255+a+1),this[b]=255&a,b+1},g.prototype.writeInt16LE=function(a,b,c){return a=+a,b=0|b,c||J(this,a,b,2,32767,-32768),g.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8):K(this,a,b,!0),b+2},g.prototype.writeInt16BE=function(a,b,c){return a=+a,b=0|b,c||J(this,a,b,2,32767,-32768),g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=255&a):K(this,a,b,!1),b+2},g.prototype.writeInt32LE=function(a,b,c){return a=+a,b=0|b,c||J(this,a,b,4,2147483647,-2147483648),g.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):L(this,a,b,!0),b+4},g.prototype.writeInt32BE=function(a,b,c){return a=+a,b=0|b,c||J(this,a,b,4,2147483647,-2147483648),0>a&&(a=4294967295+a+1),g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a):L(this,a,b,!1),b+4},g.prototype.writeFloatLE=function(a,b,c){return N(this,a,b,!0,c)},g.prototype.writeFloatBE=function(a,b,c){return N(this,a,b,!1,c)},g.prototype.writeDoubleLE=function(a,b,c){return O(this,a,b,!0,c)},g.prototype.writeDoubleBE=function(a,b,c){return O(this,a,b,!1,c)},g.prototype.copy=function(a,b,c,d){if(c||(c=0),d||0===d||(d=this.length),b>=a.length&&(b=a.length),b||(b=0),d>0&&c>d&&(d=c),d===c)return 0;if(0===a.length||0===this.length)return 0;if(0>b)throw new RangeError("targetStart out of bounds");if(0>c||c>=this.length)throw new RangeError("sourceStart out of bounds");if(0>d)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length),a.length-b<d-c&&(d=a.length-b+c);var e,f=d-c;if(this===a&&b>c&&d>b)for(e=f-1;e>=0;e--)a[e+b]=this[e+c];else if(1e3>f||!g.TYPED_ARRAY_SUPPORT)for(e=0;f>e;e++)a[e+b]=this[e+c];else Uint8Array.prototype.set.call(a,this.subarray(c,c+f),b);return f},g.prototype.fill=function(a,b,c,d){if("string"==typeof a){if("string"==typeof b?(d=b,b=0,c=this.length):"string"==typeof c&&(d=c,c=this.length),1===a.length){var e=a.charCodeAt(0);256>e&&(a=e)}if(void 0!==d&&"string"!=typeof d)throw new TypeError("encoding must be a string");if("string"==typeof d&&!g.isEncoding(d))throw new TypeError("Unknown encoding: "+d)}else"number"==typeof a&&(a=255&a);if(0>b||this.length<b||this.length<c)throw new RangeError("Out of range index");if(b>=c)return this;b>>>=0,c=void 0===c?this.length:c>>>0,a||(a=0);var f;if("number"==typeof a)for(f=b;c>f;f++)this[f]=a;else{var h=g.isBuffer(a)?a:S(new g(a,d).toString()),i=h.length;for(f=0;c-b>f;f++)this[f+b]=h[f%i]}return this};var aa=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":8,ieee754:9,isarray:10}],8:[function(a,b,c){"use strict";function d(){for(var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b=0,c=a.length;c>b;++b)i[b]=a[b],j[a.charCodeAt(b)]=b;j["-".charCodeAt(0)]=62,j["_".charCodeAt(0)]=63}function e(a){var b,c,d,e,f,g,h=a.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f="="===a[h-2]?2:"="===a[h-1]?1:0,g=new k(3*h/4-f),d=f>0?h-4:h;var i=0;for(b=0,c=0;d>b;b+=4,c+=3)e=j[a.charCodeAt(b)]<<18|j[a.charCodeAt(b+1)]<<12|j[a.charCodeAt(b+2)]<<6|j[a.charCodeAt(b+3)],g[i++]=e>>16&255,g[i++]=e>>8&255,g[i++]=255&e;return 2===f?(e=j[a.charCodeAt(b)]<<2|j[a.charCodeAt(b+1)]>>4,g[i++]=255&e):1===f&&(e=j[a.charCodeAt(b)]<<10|j[a.charCodeAt(b+1)]<<4|j[a.charCodeAt(b+2)]>>2,g[i++]=e>>8&255,g[i++]=255&e),g}function f(a){return i[a>>18&63]+i[a>>12&63]+i[a>>6&63]+i[63&a]}function g(a,b,c){for(var d,e=[],g=b;c>g;g+=3)d=(a[g]<<16)+(a[g+1]<<8)+a[g+2],e.push(f(d));return e.join("")}function h(a){for(var b,c=a.length,d=c%3,e="",f=[],h=16383,j=0,k=c-d;k>j;j+=h)f.push(g(a,j,j+h>k?k:j+h));return 1===d?(b=a[c-1],e+=i[b>>2],e+=i[b<<4&63],e+="=="):2===d&&(b=(a[c-2]<<8)+a[c-1],e+=i[b>>10],e+=i[b>>4&63],e+=i[b<<2&63],e+="="),f.push(e),f.join("")}c.toByteArray=e,c.fromByteArray=h;var i=[],j=[],k="undefined"!=typeof Uint8Array?Uint8Array:Array;d()},{}],9:[function(a,b,c){c.read=function(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<<h)-1,j=i>>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?NaN:(n?-1:1)*(1/0);g+=Math.pow(2,d),f-=j}return(n?-1:1)*g*Math.pow(2,f-d)},c.write=function(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<<j)-1,l=k>>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=0>b||0===b&&0>1/b?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<<e|h,j+=e;j>0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p}},{}],10:[function(a,b,c){var d={}.toString;b.exports=Array.isArray||function(a){return"[object Array]"==d.call(a)}},{}],11:[function(a,b,c){"use strict";function d(a,b){for(var c=0;c<a.length;c++)b(a[c])}function e(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}function f(a,b,c){var d=a;return l(b)?(c=b,"string"==typeof a&&(d={uri:a})):d=n(b,{uri:a}),d.callback=c,d}function g(a,b,c){return b=f(a,b,c),h(b)}function h(a){function b(){4===j.readyState&&f()}function c(){var a=void 0;if(j.response?a=j.response:"text"!==j.responseType&&j.responseType||(a=j.responseText||j.responseXML),u)try{a=JSON.parse(a)}catch(b){}return a}function d(a){clearTimeout(o),a instanceof Error||(a=new Error(""+(a||"Unknown XMLHttpRequest Error"))),a.statusCode=0,h(a,i)}function f(){if(!n){var b;clearTimeout(o),b=a.useXDR&&void 0===j.status?200:1223===j.status?204:j.status;var d=i,e=null;0!==b?(d={body:c(),statusCode:b,method:q,headers:{},url:p,rawRequest:j},j.getAllResponseHeaders&&(d.headers=m(j.getAllResponseHeaders()))):e=new Error("Internal XMLHttpRequest Error"),h(e,d,d.body)}}var h=a.callback;if("undefined"==typeof h)throw new Error("callback argument missing");h=k(h);var i={body:void 0,headers:{},statusCode:0,method:q,url:p,rawRequest:j},j=a.xhr||null;j||(j=a.cors||a.useXDR?new g.XDomainRequest:new g.XMLHttpRequest);var l,n,o,p=j.url=a.uri||a.url,q=j.method=a.method||"GET",r=a.body||a.data||null,s=j.headers=a.headers||{},t=!!a.sync,u=!1;if("json"in a&&(u=!0,s.accept||s.Accept||(s.Accept="application/json"),"GET"!==q&&"HEAD"!==q&&(s["content-type"]||s["Content-Type"]||(s["Content-Type"]="application/json"),r=JSON.stringify(a.json))),j.onreadystatechange=b,j.onload=f,j.onerror=d,j.onprogress=function(){},j.ontimeout=d,j.open(q,p,!t,a.username,a.password),t||(j.withCredentials=!!a.withCredentials),!t&&a.timeout>0&&(o=setTimeout(function(){n=!0,j.abort("timeout");var a=new Error("XMLHttpRequest timeout");a.code="ETIMEDOUT",d(a)},a.timeout)),j.setRequestHeader)for(l in s)s.hasOwnProperty(l)&&j.setRequestHeader(l,s[l]);else if(a.headers&&!e(a.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in a&&(j.responseType=a.responseType),"beforeSend"in a&&"function"==typeof a.beforeSend&&a.beforeSend(j),j.send(r),j}function i(){}var j=a("global/window"),k=a("once"),l=a("is-function"),m=a("parse-headers"),n=a("xtend");b.exports=g,g.XMLHttpRequest=j.XMLHttpRequest||i,g.XDomainRequest="withCredentials"in new g.XMLHttpRequest?g.XMLHttpRequest:j.XDomainRequest,d(["get","put","post","patch","head","delete"],function(a){g["delete"===a?"del":a]=function(b,c,d){return c=f(b,c,d),c.method=a.toUpperCase(),h(c)}})},{"global/window":12,"is-function":13,once:14,"parse-headers":17,xtend:18}],12:[function(a,b,c){(function(a){"undefined"!=typeof window?b.exports=window:"undefined"!=typeof a?b.exports=a:"undefined"!=typeof self?b.exports=self:b.exports={}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],13:[function(a,b,c){function d(a){var b=e.call(a);return"[object Function]"===b||"function"==typeof a&&"[object RegExp]"!==b||"undefined"!=typeof window&&(a===window.setTimeout||a===window.alert||a===window.confirm||a===window.prompt); | ||
}b.exports=d;var e=Object.prototype.toString},{}],14:[function(a,b,c){function d(a){var b=!1;return function(){return b?void 0:(b=!0,a.apply(this,arguments))}}b.exports=d,d.proto=d(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return d(this)},configurable:!0})})},{}],15:[function(a,b,c){function d(a,b,c){if(!h(b))throw new TypeError("iterator must be a function");arguments.length<3&&(c=this),"[object Array]"===i.call(a)?e(a,b,c):"string"==typeof a?f(a,b,c):g(a,b,c)}function e(a,b,c){for(var d=0,e=a.length;e>d;d++)j.call(a,d)&&b.call(c,a[d],d,a)}function f(a,b,c){for(var d=0,e=a.length;e>d;d++)b.call(c,a.charAt(d),d,a)}function g(a,b,c){for(var d in a)j.call(a,d)&&b.call(c,a[d],d,a)}var h=a("is-function");b.exports=d;var i=Object.prototype.toString,j=Object.prototype.hasOwnProperty},{"is-function":13}],16:[function(a,b,c){function d(a){return a.replace(/^\s*|\s*$/g,"")}c=b.exports=d,c.left=function(a){return a.replace(/^\s*/,"")},c.right=function(a){return a.replace(/\s*$/,"")}},{}],17:[function(a,b,c){var d=a("trim"),e=a("for-each"),f=function(a){return"[object Array]"===Object.prototype.toString.call(a)};b.exports=function(a){if(!a)return{};var b={};return e(d(a).split("\n"),function(a){var c=a.indexOf(":"),e=d(a.slice(0,c)).toLowerCase(),g=d(a.slice(c+1));"undefined"==typeof b[e]?b[e]=g:f(b[e])?b[e].push(g):b[e]=[b[e],g]}),b}},{"for-each":15,trim:16}],18:[function(a,b,c){function d(){for(var a={},b=0;b<arguments.length;b++){var c=arguments[b];for(var d in c)e.call(c,d)&&(a[d]=c[d])}return a}b.exports=d;var e=Object.prototype.hasOwnProperty},{}]},{},[4])(4)}); |
@@ -16,3 +16,3 @@ 'use strict'; | ||
commitMessage: 'Release v%VERSION%', | ||
commitFiles: ['package.json','bower.json','dist/stormpath.js','dist/stormpath.min.js','README.md'], | ||
commitFiles: ['package.json','bower.json','dist/stormpath.js','dist/stormpath.min.js','README.md','CHANGELOG.md'], | ||
createTag: true, | ||
@@ -19,0 +19,0 @@ tagName: '%VERSION%', |
@@ -43,9 +43,3 @@ // Karma configuration | ||
// - IE (only Windows) | ||
browsers: [ | ||
// 'Chrome' | ||
'sl_firefox_20' | ||
// 'sl_firefox_latest', | ||
// 'sl_safari_8' | ||
// 'Safari' | ||
], | ||
browsers: ['Chrome'], | ||
@@ -62,3 +56,3 @@ browserify: { | ||
reporters: ['progress','coverage','saucelabs'], | ||
reporters: ['progress','coverage'], | ||
@@ -68,62 +62,4 @@ | ||
// if true, it capture browsers, run tests and exit | ||
singleRun: false, | ||
customLaunchers: { | ||
sl_firefox_20: { | ||
base: 'SauceLabs', | ||
browserName: 'firefox', | ||
version: '20' | ||
}, | ||
sl_firefox_latest: { | ||
base: 'SauceLabs', | ||
browserName: 'firefox' | ||
}, | ||
sl_chrome_latest: { | ||
base: 'SauceLabs', | ||
browserName: 'chrome' | ||
}, | ||
sl_ie_11: { | ||
base: 'SauceLabs', | ||
browserName: 'internet explorer', | ||
platform: 'Windows 8.1', | ||
version: '11' | ||
}, | ||
sl_ie_10: { | ||
base: 'SauceLabs', | ||
browserName: 'internet explorer', | ||
platform: 'Windows 7', | ||
version: '10' | ||
}, | ||
sl_ios_safari: { | ||
base: 'SauceLabs', | ||
browserName: 'iphone', | ||
platform: 'OS X 10.9', | ||
version: '7.1' | ||
}, | ||
sl_safari_9: { | ||
base: 'SauceLabs', | ||
browserName: 'safari', | ||
platform: 'OS X 10.11', | ||
version: '9.0' | ||
}, | ||
sl_safari_8: { | ||
base: 'SauceLabs', | ||
browserName: 'safari', | ||
platform: 'OS X 10.10', | ||
version: '8.0' | ||
} | ||
}, | ||
sauceLabs: { | ||
testName: 'Stormpat.js Tests', | ||
startConnect: false, | ||
connectOptions: { | ||
username: 'robertstormpath', | ||
accessKey: 'e2b4e841-2b18-4231-b22a-9d119242a20f', | ||
tunnelIdentifier: '18910e9d5858477db24623cc438e0803' | ||
} | ||
} | ||
singleRun: false | ||
}); | ||
}; |
@@ -46,6 +46,6 @@ 'use strict'; | ||
self.appHref = self.jwtPayload.app_href; | ||
self.sptoken = self.jwtPayload.sp_token || null; | ||
self.sptoken = self.getPasswordResetToken(); | ||
self.baseurl = self.appHref.match('^.+//([^\/]+)\/')[0]; | ||
var idSiteParentResource = self.appHref; | ||
self.idSiteParentResource = self.appHref; | ||
@@ -57,3 +57,3 @@ if (self.jwtPayload.onk) { | ||
if (self.jwtPayload.asnk) { | ||
idSiteParentResource = self.jwtPayload.ash; | ||
self.idSiteParentResource = self.jwtPayload.ash; | ||
} | ||
@@ -65,3 +65,3 @@ | ||
method: 'GET', | ||
url: idSiteParentResource + '?expand=idSiteModel', | ||
url: self.idSiteParentResource + '?expand=idSiteModel', | ||
json: true | ||
@@ -72,3 +72,3 @@ }, | ||
if (err.status === 401) { | ||
return cb(new Error(strings.errors.INITIAL_JWT_REJECTED)); | ||
return cb(new Error(strings.errors.SESSION_EXPIRED)); | ||
} | ||
@@ -87,2 +87,7 @@ return cb(err); | ||
} | ||
if (!opts.token) { | ||
self.saveSessionToken(); | ||
} | ||
cb(null,application.idSiteModel); | ||
@@ -132,2 +137,3 @@ } | ||
* Attempts to fetch the JWT from the ?jwt=X location in the window URL. | ||
* If not present, fetches from cookies. | ||
* Returns an empty string if not found | ||
@@ -137,6 +143,55 @@ * @return {string} JWT | ||
Client.prototype.getJwtFromUrl = function () { | ||
return decodeURIComponent( (window.location.href.match(/jwt=([^&]+)/) || [])[1] || '' ); | ||
var jwtMatch = window.location.href.match(/jwt=([^&]+)/); | ||
var jwtCookie = utils.getCookie('idSiteJwt'); | ||
if (jwtMatch) { | ||
window.location.replace( (window.location+'').replace(/\?jwt=([^&]+)/, '') ); | ||
return decodeURIComponent(jwtMatch[1]) | ||
} else if (jwtCookie) { | ||
document.cookie = 'idSiteJwt=' + ''; | ||
return jwtCookie; | ||
} else { | ||
return ''; | ||
} | ||
}; | ||
Client.prototype.saveSessionToken = function() { | ||
// With our new access token, remove the previous access token from | ||
// the hash and save the new one to the cookie | ||
document.cookie = 'idSiteJwt=' + this.requestExecutor.authToken; | ||
} | ||
/** | ||
* Attempts to fetch the password reset token from the JWT | ||
* Returns an null if not found | ||
* @return {string} Password Reset Token | ||
*/ | ||
Client.prototype.getPasswordResetToken = function() { | ||
var self = this; | ||
if (self.jwtPayload.sp_token) { | ||
return self.jwtPayload.sp_token; | ||
} else { | ||
// We need to get the token from jwt.scope.application.SLUG.passwordResetToken.SLUG | ||
// See https://gist.github.com/edjiang/a570a4d9e60d08492def97938b35cdfa for an example token | ||
var applicationId = self.appHref.match(/[^\/]+$/)[0]; | ||
var application = self.jwtPayload.scope.application[applicationId]; | ||
// Get all things in the application object, reduce to just the password reset token object | ||
var passwordResetTokens = application.map(function(contents) { | ||
return contents.passwordResetToken; | ||
}).reduce(function(previous, current) { | ||
return previous || current; | ||
}).map(function(contents) { | ||
// Get all password reset token objects, reduce to just the slug | ||
return typeof contents == 'object' ? contents : null; | ||
}).reduce(function(previous, current) { | ||
return previous || current; | ||
}); | ||
// Return the password reset token or null | ||
return passwordResetTokens ? Object.keys(passwordResetTokens)[0] : null; | ||
} | ||
} | ||
/** | ||
* Make a login attempt against the REST API, given the credentials and | ||
@@ -212,3 +267,3 @@ * application context. | ||
method: 'POST', | ||
url: client.appHref+'/accounts', | ||
url: client.idSiteParentResource+'/accounts', | ||
json: data | ||
@@ -261,3 +316,8 @@ }, | ||
}, | ||
callback | ||
function(err, body) { | ||
client.saveSessionToken(); | ||
if (callback) { | ||
callback(err, body); | ||
} | ||
} | ||
); | ||
@@ -264,0 +324,0 @@ }; |
@@ -35,5 +35,5 @@ 'use strict'; | ||
var executor = this; | ||
var newToken = response.headers.authorization || response.rawRequest.getResponseHeader && response.rawRequest.getResponseHeader('Authorization'); | ||
var newToken = response.headers.authorization; | ||
var parsedToken = null; | ||
var serviceProviderCallbackUrl = response.headers['stormpath-sso-redirect-location'] || response.rawRequest.getResponseHeader && response.rawRequest.getResponseHeader('stormpath-sso-redirect-location'); | ||
var serviceProviderCallbackUrl = response.headers['stormpath-sso-redirect-location']; | ||
@@ -65,2 +65,8 @@ if (newToken) { | ||
} | ||
if (response.statusCode === 403 && !body) { | ||
body = { | ||
status: 403, | ||
message: 'Forbidden' | ||
}; | ||
} | ||
return requestorCallback(body); | ||
@@ -103,3 +109,3 @@ } | ||
if (!executor.authToken) { | ||
return callback(new Error(strings.errors.NO_AUTH_TOKEN)); | ||
return setTimeout(callback.bind(null,new Error(strings.errors.SESSION_EXPIRED)),1); | ||
} | ||
@@ -106,0 +112,0 @@ |
{ | ||
"errors": { | ||
"JWT_NOT_FOUND": "JWT not found as url query parameter.", | ||
"JWT_NOT_FOUND": "Login session not initialized.", | ||
"NOT_A_JWT": "JWT does not appear to be a property formatted JWT.", | ||
@@ -8,4 +8,5 @@ "MALFORMED_JWT_CLAIMS": "The JWT claims section is malfomed and could not be decoded as JSON.", | ||
"INVALID_AUTH_TOKEN_HEADER": "HTTP response has an invalid Authorization header.", | ||
"INITIAL_JWT_REJECTED": "The JWT used to initialized the client was rejected." | ||
"INITIAL_JWT_REJECTED": "Your login session is expired.", | ||
"SESSION_EXPIRED": "Your login session is expired." | ||
} | ||
} |
'use strict'; | ||
var Buffer = require('buffer/').Buffer; | ||
/** | ||
@@ -14,6 +16,13 @@ * @function | ||
function getCookie(name) { | ||
var cookie = document.cookie.match(new RegExp(name + '=([^;]+)')); | ||
if (cookie) { | ||
return cookie[1]; | ||
} | ||
} | ||
module.exports = { | ||
base64: { | ||
atob: function atob(str){ | ||
return decodeURIComponent(window.atob(str)); | ||
return new Buffer(str,'base64').toString(); | ||
}, | ||
@@ -25,3 +34,4 @@ btoa: function btoa(str){ | ||
}, | ||
noop: function(){} | ||
noop: function(){}, | ||
getCookie: getCookie | ||
}; |
{ | ||
"name": "stormpath-js", | ||
"version": "0.5.2", | ||
"version": "0.7.1", | ||
"description": "A browser-ready javascript library for Stormpath. Use this library if you are building your own ID Site from scratch. Additional features may be added in the future.", | ||
@@ -43,3 +43,2 @@ "main": "lib/index.js", | ||
"karma-mocha": "^0.2.1", | ||
"karma-sauce-launcher": "^0.3.0", | ||
"load-grunt-tasks": "^3.4.0", | ||
@@ -49,4 +48,5 @@ "mocha": "^2.3.4" | ||
"dependencies": { | ||
"buffer": "^4.6.0", | ||
"xhr": "^2.2.0" | ||
} | ||
} |
@@ -254,38 +254,3 @@ # Stormpath.js | ||
# Changelog | ||
### 0.4.1 | ||
**Not Yet Released** | ||
### 0.4.0 | ||
**Released on October 23rd, 2015** | ||
* Refactoring the internal request executor to supply contextual error messages | ||
* Fixing https://github.com/stormpath/idsite-src/issues/2 by not sending cookies | ||
on requests to the API | ||
**Breaking Changes** | ||
* `client._getToken()` has been renamed to `client.getJwtFromUrl()` | ||
* The value `response.redirectUrl` has been renamed to `response.serviceProviderCallbackUrl`. This affects the callbacks for `client.login()` and `client.register()` | ||
### 0.3.1 | ||
Fixing the base64 encoding strategy, unicode characters are now supported. | ||
### 0.3.0 | ||
Adding support for Organizations | ||
### 0.2.0 | ||
Support for Single-Sign-On (SSO) | ||
### 0.1.0 | ||
First release! This release includes all the methods that you need to | ||
build your own ID Site | ||
# Contributing | ||
@@ -292,0 +257,0 @@ |
Sorry, the diff of this file is too big to display
188371
21
34
3983
2
260
+ Addedbuffer@^4.6.0
+ Addedbase64-js@1.5.1(transitive)
+ Addedbuffer@4.9.2(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedisarray@1.0.0(transitive)