forked from aws-samples/aws-cognito-quicksight-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
amazon-cognito-auth.min.js
98 lines (93 loc) · 23.3 KB
/
amazon-cognito-auth.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*!
* Copyright 2017 Amazon.com,
* Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the
* License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, express or implied. See the License
* for the specific language governing permissions and
* limitations under the License.
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("aws-sdk/global"),require("aws-sdk/clients/cognitoidentityserviceprovider")):"function"==typeof define&&define.amd?define(["aws-sdk/global","aws-sdk/clients/cognitoidentityserviceprovider"],e):"object"==typeof exports?exports.AmazonCognitoIdentity=e(require("aws-sdk/global"),require("aws-sdk/clients/cognitoidentityserviceprovider")):t.AmazonCognitoIdentity=e(t.AWSCognito,t.AWSCognito.CognitoIdentityServiceProvider)}(this,function(t,e){return function(t){function e(o){if(n[o])return n[o].exports;var s=n[o]={exports:{},id:o,loaded:!1};return t[o].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function s(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(10);Object.keys(i).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return i[t]}})});var r=n(11),a=s(r),c=o(i);Object.keys(c).forEach(function(t){a.default[t]=c[t]}),/*!
* Amazon Cognito Auth SDK for JavaScript
* Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file.
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
* OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions
* and limitations under the License.
*/
"undefined"!=typeof window&&!window.crypto&&window.msCrypto&&(window.crypto=window.msCrypto)},function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var s=n(7),i=function(){function t(e){o(this,t),this.jwtToken=e||""}return t.prototype.getJwtToken=function(){return this.jwtToken},t.prototype.setJwtToken=function(t){this.jwtToken=t},t.prototype.getExpiration=function(){var t=this.jwtToken.split(".")[1],e=JSON.parse(s.util.base64.decode(t).toString("utf8"));return e.exp},t.prototype.getUsername=function(){if(null!==this.jwtToken){var t=this.jwtToken.split(".")[1],e=JSON.parse(s.util.base64.decode(t).toString("utf8"));return e.username}},t}();e.default=i},function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var s=n(7),i=function(){function t(e){o(this,t),this.jwtToken=e||""}return t.prototype.getJwtToken=function(){return this.jwtToken},t.prototype.setJwtToken=function(t){this.jwtToken=t},t.prototype.getExpiration=function(){var t=this.jwtToken.split(".")[1],e=JSON.parse(s.util.base64.decode(t).toString("utf8"));return e.exp},t}();e.default=i},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;/*!
* Amazon Cognito Auth SDK for JavaScript
* Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file.
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
* OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions
* and limitations under the License.
*/
var o=function(){function t(e){n(this,t),this.refreshToken=e||""}return t.prototype.getToken=function(){return this.refreshToken},t.prototype.setToken=function(t){this.refreshToken=t},t}();e.default=o},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;/*!
* Amazon Cognito Auth SDK for JavaScript
* Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file.
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
* OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions
* and limitations under the License.
*/
var o=function(){function t(e){n(this,t),this.tokenScopes=e||[]}return t.prototype.getScopes=function(){return this.tokenScopes},t.prototype.setTokenScopes=function(t){this.tokenScopes=t},t}();e.default=o},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var i=n(4),r=o(i),a=n(1),c=o(a),u=n(2),g=o(u),h=n(3),p=o(h),f=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.IdToken,o=e.RefreshToken,i=e.AccessToken,a=e.TokenScopes;s(this,t),n?this.idToken=n:this.idToken=new g.default,o?this.refreshToken=o:this.refreshToken=new p.default,i?this.accessToken=i:this.accessToken=new c.default,a?this.tokenScopes=a:this.tokenScopes=new r.default}return t.prototype.getIdToken=function(){return this.idToken},t.prototype.setIdToken=function(t){this.idToken=t},t.prototype.getRefreshToken=function(){return this.refreshToken},t.prototype.setRefreshToken=function(t){this.refreshToken=t},t.prototype.getAccessToken=function(){return this.accessToken},t.prototype.setAccessToken=function(t){this.accessToken=t},t.prototype.getTokenScopes=function(){return this.tokenScopes},t.prototype.setTokenScopes=function(t){this.tokenScopes=t},t.prototype.isValid=function(){var t=Math.floor(new Date/1e3);try{return null!=this.accessToken?t<this.accessToken.getExpiration():null!=this.idToken&&t<this.idToken.getExpiration()}catch(t){return!1}},t}();e.default=f},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;/*!
* Amazon Cognito Auth SDK for JavaScript
* Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file.
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
* OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions
* and limitations under the License.
*/
var o={},s=function(){function t(){n(this,t)}return t.setItem=function(t,e){return o[t]=e,o[t]},t.getItem=function(t){return Object.prototype.hasOwnProperty.call(o,t)?o[t]:void 0},t.removeItem=function(t){return delete o[t]},t.clear=function(){return o={}},t}(),i=function(){function t(){n(this,t);try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.cognito.test-ls",1),this.storageWindow.removeItem("aws.cognito.test-ls")}catch(t){this.storageWindow=s}}return t.prototype.getStorage=function(){return this.storageWindow},t}();e.default=i},function(e,n){e.exports=t},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=n(4),a=o(r),c=n(1),u=o(c),g=n(2),h=o(g),p=n(3),f=o(p),S=n(5),C=o(S),d=n(6),l=o(d),T=function(){function t(e){s(this,t);var n=e||{},o=n.ClientId,i=n.AppWebDomain,r=n.TokenScopesArray,c=n.RedirectUriSignIn,u=n.RedirectUriSignOut;if(!(null!=e&&o&&i&&c&&u))throw new Error(this.getCognitoConstants().PARAMETERERROR);if(this.clientId=o,this.appWebDomain=i,!Array.isArray(r))throw new Error(this.getCognitoConstants().SCOPETYPEERROR);this.TokenScopesArray=r||[];var g=new a.default(this.TokenScopesArray);this.RedirectUriSignIn=c,this.RedirectUriSignOut=u,this.signInUserSession=new C.default,this.responseType=this.getCognitoConstants().TOKEN,this.storage=(new l.default).getStorage(),this.signInUserSession.setTokenScopes(g),this.username=this.getLastUser()}return t.prototype.getCognitoConstants=function(){var t={DOMAIN_SCHEME:"https",DOMAIN_PATH_SIGNIN:"authorize",DOMAIN_PATH_SIGNOUT:"logout",DOMAIN_QUERY_PARAM_REDIRECT_URI:"redirect_uri",DOMAIN_QUERY_PARAM_SIGNOUT_URI:"logout_uri",DOMAIN_QUERY_PARAM_RESPONSE_TYPE:"response_type",CLIENT_ID:"client_id",STATE:"state",SCOPE:"scope",TOKEN:"token",CODE:"code",POST:"POST",PARAMETERERROR:"The parameters: App client Id, App web domainand the rediect URL when you are signed in are required.",SCOPETYPEERROR:"Scopes have to be array type. ",QUESTIONMARK:"?",POUNDSIGN:"#",COLONDOUBLESLASH:"://",SLASH:"/",AMPERSAND:"&",EQUALSIGN:"=",SPACE:" ",CONTENTTYPE:"Content-Type",CONTENTTYPEVALUE:"application/x-www-form-urlencoded",AUTHORIZATIONCODE:"authorization_code",IDTOKEN:"id_token",ACCESSTOKEN:"access_token",REFRESHTOKEN:"refresh_token",ERROR:"error",STRINGTYPE:"string",STATELENGTH:32,STATEORIGINSTRING:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",WITHCREDENTIALS:"withCredentials",UNDEFINED:"undefined",SELF:"_self",HOSTNAMEREGEX:/:\/\/([0-9]?\.)?(.[^\/:]+)/i,QUERYPARAMETERREGEX1:/#(.+)/,QUERYPARAMETERREGEX2:/=(.+)/,HEADER:{"Content-Type":"application/x-www-form-urlencoded"}};return t},t.prototype.getClientId=function(){return this.clientId},t.prototype.getAppWebDomain=function(){return this.appWebDomain},t.prototype.getCurrentUser=function(){var t="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",e=this.storage.getItem(t);return e},t.prototype.setUser=function(t){this.username=t},t.prototype.useCodeGrantFlow=function(){this.responseType=this.getCognitoConstants().CODE},t.prototype.useImplicitFlow=function(){this.responseType=this.getCognitoConstants().TOKEN},t.prototype.getSignInUserSession=function(){return this.signInUserSession},t.prototype.getUsername=function(){return this.username},t.prototype.setUsername=function(t){this.username=t},t.prototype.getSession=function(){var t=new Set(this.TokenScopesArray),e=new Set(this.signInUserSession.tokenScopes.getScopes()),n=this.getFQDNSignIn();if(null!=this.signInUserSession&&this.signInUserSession.isValid())return this.userhandler.onSuccess(this.signInUserSession);if(this.signInUserSession=this.getCachedSession(),this.compareSets(t,e)){if(this.signInUserSession.isValid())return this.userhandler.onSuccess(this.signInUserSession);this.signInUserSession.getRefreshToken()&&this.signInUserSession.getRefreshToken().getToken()?this.refreshSession(this.signInUserSession.getRefreshToken().getToken()):this.launchUri(n)}else{var o=new a.default(this.TokenScopesArray),s=new h.default,i=new u.default,r=new f.default;this.signInUserSession.setTokenScopes(o),this.signInUserSession.setIdToken(s),this.signInUserSession.setAccessToken(i),this.signInUserSession.setRefreshToken(r),this.launchUri(n)}},t.prototype.parseCognitoWebResponse=function(t){t.indexOf(this.getCognitoConstants().QUESTIONMARK)>-1?this.getCodeQueryParameter(t):t.indexOf(this.getCognitoConstants().POUNDSIGN)>-1&&this.getTokenQueryParameter(t)},t.prototype.getCodeQueryParameter=function(t){var e=new Map;if(e=this.getQueryParameters(t,e),e.has(this.getCognitoConstants().CODE)){var n=this.getCodeParameter(t),o=this.getCognitoConstants().DOMAIN_SCHEME.concat(this.getCognitoConstants().COLONDOUBLESLASH,this.getAppWebDomain(),this.getCognitoConstants().SLASH,this.getCognitoConstants().TOKEN),s=this.getCognitoConstants().HEADER,i={grant_type:this.getCognitoConstants().AUTHORIZATIONCODE,client_id:this.getClientId(),redirect_uri:this.RedirectUriSignIn,code:n},r=this.onSuccessExchangeForToken.bind(this),a=this.onFailure.bind(this);this.makePOSTRequest(s,i,o,r,a)}},t.prototype.getTokenQueryParameter=function(t){var e=new Map;e=this.getQueryParameters(t,e);var n=new h.default,o=new u.default,s=new f.default;return t.indexOf(this.getCognitoConstants().IDTOKEN)>-1?(n.setJwtToken(e.get(this.getCognitoConstants().IDTOKEN)),this.signInUserSession.setIdToken(n)):this.signInUserSession.setIdToken(n),t.indexOf(this.getCognitoConstants().ACCESSTOKEN)>-1?(o.setJwtToken(e.get(this.getCognitoConstants().ACCESSTOKEN)),this.signInUserSession.setAccessToken(o)):this.signInUserSession.setAccessToken(o),t.indexOf(this.getCognitoConstants().REFRESHTOKEN)>-1?(s.setToken(e.get(this.getCognitoConstants().REFRESHTOKEN)),this.signInUserSession.setRefreshToken(s)):this.signInUserSession.setRefreshToken(s),this.cacheTokensScopes(),this.userhandler.onSuccess(this.signInUserSession)},t.prototype.getCachedSession=function(){if(!this.username)return new C.default;var t="CognitoIdentityServiceProvider."+this.getClientId()+"."+this.username,e=t+".idToken",n=t+".accessToken",o=t+".refreshToken",s=t+".tokenScopesString",i=this.storage.getItem(s),r=[];i&&(r=i.split(" "));var c=new a.default(r),g=new h.default(this.storage.getItem(e)),p=new u.default(this.storage.getItem(n)),S=new f.default(this.storage.getItem(o)),d={IdToken:g,AccessToken:p,RefreshToken:S,TokenScopes:c},l=new C.default(d);return l},t.prototype.getLastUser=function(){var t="CognitoIdentityServiceProvider."+this.getClientId(),e=t+".LastAuthUser",n=this.storage.getItem(e);if(n)return n},t.prototype.cacheTokensScopes=function(){var t="CognitoIdentityServiceProvider."+this.getClientId(),e=this.signInUserSession.getAccessToken().getUsername(),n=t+"."+e+".idToken",o=t+"."+e+".accessToken",s=t+"."+e+".refreshToken",i=t+".LastAuthUser",r=t+"."+e+".tokenScopesString",a=this.signInUserSession.getTokenScopes().getScopes(),c=a.join(" ");this.storage.setItem(n,this.signInUserSession.getIdToken().getJwtToken()),this.storage.setItem(o,this.signInUserSession.getAccessToken().getJwtToken()),this.storage.setItem(s,this.signInUserSession.getRefreshToken().getToken()),this.storage.setItem(i,e),this.storage.setItem(r,c)},t.prototype.compareSets=function(t,e){if(t.size!==e.size)return!1;for(var n=t,o=Array.isArray(n),s=0,n=o?n:n[Symbol.iterator]();;){var i;if(o){if(s>=n.length)break;i=n[s++]}else{if(s=n.next(),s.done)break;i=s.value}var r=i;if(!e.has(r))return!1}return!0},t.prototype.getHostName=function(t){var e=t.match(this.getCognitoConstants().HOSTNAMEREGEX);if(null!=e&&e.length>2&&i(e[2])===this.getCognitoConstants().STRINGTYPE&&e[2].length>0)return e[2]},t.prototype.getQueryParameters=function(t,e){var n=String(t).split(this.getCognitoConstants().QUERYPARAMETERREGEX1),o=n[1],s=String(o).split(this.getCognitoConstants().AMPERSAND),i=s.length,r=void 0;for(r=0;r<i;r++)s[r]=String(s[r]).split(this.getCognitoConstants().QUERYPARAMETERREGEX2),e.set(s[r][0],s[r][1]);return e},t.prototype.getCodeParameter=function(t){var e=String(t).split(this.getCognitoConstants().QUESTIONMARK),n=e[1],o=String(n).split(this.getCognitoConstants().EQUALSIGN),s=o[1];return s},t.prototype.generateRandomString=function(t,e){for(var n="",o=t;o>0;--o)n+=e[Math.round(Math.random()*(e.length-1))];return n},t.prototype.clearCachedTokensScopes=function(){var t="CognitoIdentityServiceProvider."+this.getClientId(),e=t+"."+this.username+".idToken",n=t+"."+this.username+".accessToken",o=t+"."+this.username+".refreshToken",s=t+".LastAuthUser",i=t+"."+this.username+".tokenScopesString";this.storage.removeItem(e),this.storage.removeItem(n),this.storage.removeItem(o),this.storage.removeItem(s),this.storage.removeItem(i)},t.prototype.refreshSession=function(t){var e=this.getCognitoConstants().DOMAIN_SCHEME.concat(this.getCognitoConstants().COLONDOUBLESLASH,this.getAppWebDomain(),this.getCognitoConstants().SLASH,this.getCognitoConstants().TOKEN),n=this.getCognitoConstants().HEADER,o={grant_type:this.getCognitoConstants().REFRESHTOKEN,client_id:this.getClientId(),redirect_uri:this.RedirectUriSignIn,refresh_token:t},s=this.onSuccessRefreshToken.bind(this),i=this.onFailure.bind(this);this.makePOSTRequest(n,o,e,s,i)},t.prototype.makePOSTRequest=function(t,e,n,o,s){var i=this.createCORSRequest(this.getCognitoConstants().POST,n),r="",a=0,c=0,u=i.responseText;if(i){for(;c<t.length;c++)i.setRequestHeader(c,t[c]);for(;a<e.length;a++)r=r.concat(a,this.getCognitoConstants().EQUALSIGN,e[a],this.getCognitoConstants().AMPERSAND);r=r.substring(0,r.length-1),i.send(r),i.onreadystatechange=function(){4===i.readyState&&(200===i.status?i.onload=o(u):i.onerror=s(u))}}},t.prototype.createCORSRequest=function(t,e){var n=new XMLHttpRequest;return n.open(t,e,!0),this.getCognitoConstants().WITHCREDENTIALS in n?n.open(t,e,!0):("undefined"==typeof XDomainRequest?"undefined":i(XDomainRequest))!==this.getCognitoConstants().UNDEFINED?(n=new XDomainRequest,n.open(t,e)):n=null,n},t.prototype.onFailure=function(t){this.userhandler.onFailure(t)},t.prototype.onSuccessRefreshToken=function(t){var e=JSON.parse(t);if(!Object.prototype.hasOwnProperty.call(e,this.getCognitoConstants().ERROR))return Object.prototype.hasOwnProperty.call(e,this.getCognitoConstants().IDTOKEN)&&this.signInUserSession.setIdToken(new h.default(e.id_token)),Object.prototype.hasOwnProperty.call(e,this.getCognitoConstants().ACCESSTOKEN)&&this.signInUserSession.setAccessToken(new u.default(e.access_token)),this.cacheTokensScopes(),this.userhandler.onSuccess(this.signInUserSession);var n=this.getFQDNSignIn();this.launchUri(n)},t.prototype.onSuccessExchangeForToken=function(t){var e=JSON.parse(t),n=new f.default,o=new u.default,s=new h.default;return Object.prototype.hasOwnProperty.call(e,this.getCognitoConstants().ERROR)?this.userhandler.onFailure(t):(Object.prototype.hasOwnProperty.call(e,this.getCognitoConstants().IDTOKEN)?this.signInUserSession.setIdToken(new h.default(e.id_token)):this.signInUserSession.setIdToken(s),Object.prototype.hasOwnProperty.call(e,this.getCognitoConstants().ACCESSTOKEN)?this.signInUserSession.setAccessToken(new u.default(e.access_token)):this.signInUserSession.setAccessToken(o),Object.prototype.hasOwnProperty.call(e,this.getCognitoConstants().REFRESHTOKEN)?this.signInUserSession.setRefreshToken(new f.default(e.refresh_token)):this.signInUserSession.setRefreshToken(n),this.cacheTokensScopes(),this.userhandler.onSuccess(this.signInUserSession))},t.prototype.launchUri=function(t){window.open(t,this.getCognitoConstants().SELF)},t.prototype.getSpaceSeperatedScopeString=function(){var t=this.signInUserSession.getTokenScopes().getScopes();return t=t.join(this.getCognitoConstants().SPACE),encodeURIComponent(t)},t.prototype.getFQDNSignIn=function(){var t=this.generateRandomString(this.getCognitoConstants().STATELENGTH,this.getCognitoConstants().STATEORIGINSTRING),e=this.getSpaceSeperatedScopeString(),n=this.getCognitoConstants().DOMAIN_SCHEME.concat(this.getCognitoConstants().COLONDOUBLESLASH,this.getAppWebDomain(),this.getCognitoConstants().SLASH,this.getCognitoConstants().DOMAIN_PATH_SIGNIN,this.getCognitoConstants().QUESTIONMARK,this.getCognitoConstants().DOMAIN_QUERY_PARAM_REDIRECT_URI,this.getCognitoConstants().EQUALSIGN,encodeURIComponent(this.RedirectUriSignIn),this.getCognitoConstants().AMPERSAND,this.getCognitoConstants().DOMAIN_QUERY_PARAM_RESPONSE_TYPE,this.getCognitoConstants().EQUALSIGN,this.responseType,this.getCognitoConstants().AMPERSAND,this.getCognitoConstants().CLIENT_ID,this.getCognitoConstants().EQUALSIGN,this.getClientId(),this.getCognitoConstants().AMPERSAND,this.getCognitoConstants().STATE,this.getCognitoConstants().EQUALSIGN,t,this.getCognitoConstants().AMPERSAND,this.getCognitoConstants().SCOPE,this.getCognitoConstants().EQUALSIGN,e);return n},t.prototype.signOut=function(){var t=this.getFQDNSignOut();this.signInUserSession=null,this.clearCachedTokensScopes(),this.launchUri(t)},t.prototype.getFQDNSignOut=function(){var t=this.getCognitoConstants().DOMAIN_SCHEME.concat(this.getCognitoConstants().COLONDOUBLESLASH,this.getAppWebDomain(),this.getCognitoConstants().SLASH,this.getCognitoConstants().DOMAIN_PATH_SIGNOUT,this.getCognitoConstants().QUESTIONMARK,this.getCognitoConstants().DOMAIN_QUERY_PARAM_SIGNOUT_URI,this.getCognitoConstants().EQUALSIGN,encodeURIComponent(this.RedirectUriSignOut),this.getCognitoConstants().AMPERSAND,this.getCognitoConstants().CLIENT_ID,this.getCognitoConstants().EQUALSIGN,this.getClientId());return t},t}();e.default=T},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;/*!
* Amazon Cognito Auth SDK for JavaScript
* Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file.
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
* OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions
* and limitations under the License.
*/
var o=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],s=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],i=function(){function t(){n(this,t)}return t.prototype.getNowString=function(){var t=new Date,e=s[t.getUTCDay()],n=o[t.getUTCMonth()],i=t.getUTCDate(),r=t.getUTCHours();r<10&&(r="0"+r);var a=t.getUTCMinutes();a<10&&(a="0"+a);var c=t.getUTCSeconds();c<10&&(c="0"+c);var u=t.getUTCFullYear(),g=e+" "+n+" "+i+" "+r+":"+a+":"+c+" UTC "+u;return g},t}();e.default=i},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var s=n(1);Object.defineProperty(e,"CognitoAccessToken",{enumerable:!0,get:function(){return o(s).default}});var i=n(2);Object.defineProperty(e,"CognitoIdToken",{enumerable:!0,get:function(){return o(i).default}});var r=n(3);Object.defineProperty(e,"CognitoRefreshToken",{enumerable:!0,get:function(){return o(r).default}});var a=n(4);Object.defineProperty(e,"CognitoTokenScopes",{enumerable:!0,get:function(){return o(a).default}});var c=n(8);Object.defineProperty(e,"CognitoAuth",{enumerable:!0,get:function(){return o(c).default}});var u=n(5);Object.defineProperty(e,"CognitoAuthSession",{enumerable:!0,get:function(){return o(u).default}});var g=n(9);Object.defineProperty(e,"DateHelper",{enumerable:!0,get:function(){return o(g).default}});var h=n(6);Object.defineProperty(e,"StorageHelper",{enumerable:!0,get:function(){return o(h).default}})},function(t,n){t.exports=e}])});
//# sourceMappingURL=amazon-cognito-auth.min.js.map