diff --git a/CHANGELOG.md b/CHANGELOG.md index 69f59841e..799b066cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,36 @@ # Change Log +## [v1.7.0](https://github.com/auth0/auth0-spa-js/tree/v1.7.0) (2020-04-15) + +[Full Changelog](https://github.com/auth0/auth0-spa-js/compare/v1.7.0-beta.5...v1.7.0) + +**Added** + +- Support for rotating refresh tokens [\#315](https://github.com/auth0/auth0-spa-js/pull/315) ([stevehobbsdev](https://github.com/stevehobbsdev)) +- Export types from global TypeScript file. [\#310](https://github.com/auth0/auth0-spa-js/pull/310) ([maxswa](https://github.com/maxswa)) +- Local Storage caching mechanism [\#303](https://github.com/auth0/auth0-spa-js/pull/303) ([stevehobbsdev](https://github.com/stevehobbsdev)) + +**Changed** + +- Use Web Workers for token endpoint call for in-memory storage [\#409](https://github.com/auth0/auth0-spa-js/pull/409) ([adamjmcgrath](https://github.com/adamjmcgrath)) +- Export constructor [\#385](https://github.com/auth0/auth0-spa-js/pull/385) ([adamjmcgrath](https://github.com/adamjmcgrath)) +- Fall back to iframe method if no refresh token is available [\#364](https://github.com/auth0/auth0-spa-js/pull/364) ([stevehobbsdev](https://github.com/stevehobbsdev)) +- Removed setTimeout cache removal in favour of removal-on-read [\#354](https://github.com/auth0/auth0-spa-js/pull/354) ([stevehobbsdev](https://github.com/stevehobbsdev)) +- Stop checking `isAuthenticated` cookie on initialization when using local storage [\#352](https://github.com/auth0/auth0-spa-js/pull/352) ([stevehobbsdev](https://github.com/stevehobbsdev)) +- getTokenSilently retry logic [\#336](https://github.com/auth0/auth0-spa-js/pull/336) ([stevehobbsdev](https://github.com/stevehobbsdev)) +- Fixed issue with cache not retaining refresh token [\#333](https://github.com/auth0/auth0-spa-js/pull/333) ([stevehobbsdev](https://github.com/stevehobbsdev)) + +**Fixed** + +- Check if source of event exists before closing it [\#410](https://github.com/auth0/auth0-spa-js/pull/410) ([gerritdeperrit](https://github.com/gerritdeperrit)) +- Check if iframe is still in body before removing [\#399](https://github.com/auth0/auth0-spa-js/pull/399) ([paulfalgout](https://github.com/paulfalgout)) +- Fix typings to allow custom claims in ID token [\#386](https://github.com/auth0/auth0-spa-js/pull/386) ([picosam](https://github.com/picosam)) +- Fix error in library type definitions [\#367](https://github.com/auth0/auth0-spa-js/pull/367) ([devoto13](https://github.com/devoto13)) + +**Security** + +- Dependency upgrade [\#405](https://github.com/auth0/auth0-spa-js/pull/405) ([stevehobbsdev](https://github.com/stevehobbsdev)) + ## [v1.7.0-beta.5](https://github.com/auth0/auth0-spa-js/tree/v1.7.0-beta.5) (2020-03-26) [Full Changelog](https://github.com/auth0/auth0-spa-js/compare/v1.7.0-beta.4...v1.7.0-beta.5) diff --git a/docs/assets/js/search.json b/docs/assets/js/search.json new file mode 100644 index 000000000..957f1ca20 --- /dev/null +++ b/docs/assets/js/search.json @@ -0,0 +1 @@ +{"kinds":{"32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","4194304":"Type alias"},"rows":[{"id":0,"kind":256,"name":"Auth0ClientOptions","url":"interfaces/auth0clientoptions.html","classes":"tsd-kind-interface"},{"id":1,"kind":1024,"name":"domain","url":"interfaces/auth0clientoptions.html#domain","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Auth0ClientOptions"},{"id":2,"kind":1024,"name":"issuer","url":"interfaces/auth0clientoptions.html#issuer","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Auth0ClientOptions"},{"id":3,"kind":1024,"name":"client_id","url":"interfaces/auth0clientoptions.html#client_id","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Auth0ClientOptions"},{"id":4,"kind":1024,"name":"redirect_uri","url":"interfaces/auth0clientoptions.html#redirect_uri","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Auth0ClientOptions"},{"id":5,"kind":1024,"name":"leeway","url":"interfaces/auth0clientoptions.html#leeway","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Auth0ClientOptions"},{"id":6,"kind":1024,"name":"cacheLocation","url":"interfaces/auth0clientoptions.html#cachelocation","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Auth0ClientOptions"},{"id":7,"kind":1024,"name":"useRefreshTokens","url":"interfaces/auth0clientoptions.html#userefreshtokens","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Auth0ClientOptions"},{"id":8,"kind":1024,"name":"authorizeTimeoutInSeconds","url":"interfaces/auth0clientoptions.html#authorizetimeoutinseconds","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Auth0ClientOptions"},{"id":9,"kind":1024,"name":"display","url":"interfaces/auth0clientoptions.html#display","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"Auth0ClientOptions"},{"id":10,"kind":1024,"name":"prompt","url":"interfaces/auth0clientoptions.html#prompt","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"Auth0ClientOptions"},{"id":11,"kind":1024,"name":"max_age","url":"interfaces/auth0clientoptions.html#max_age","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"Auth0ClientOptions"},{"id":12,"kind":1024,"name":"ui_locales","url":"interfaces/auth0clientoptions.html#ui_locales","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"Auth0ClientOptions"},{"id":13,"kind":1024,"name":"id_token_hint","url":"interfaces/auth0clientoptions.html#id_token_hint","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"Auth0ClientOptions"},{"id":14,"kind":1024,"name":"login_hint","url":"interfaces/auth0clientoptions.html#login_hint","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"Auth0ClientOptions"},{"id":15,"kind":1024,"name":"acr_values","url":"interfaces/auth0clientoptions.html#acr_values","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"Auth0ClientOptions"},{"id":16,"kind":1024,"name":"scope","url":"interfaces/auth0clientoptions.html#scope","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"Auth0ClientOptions"},{"id":17,"kind":1024,"name":"audience","url":"interfaces/auth0clientoptions.html#audience","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"Auth0ClientOptions"},{"id":18,"kind":1024,"name":"connection","url":"interfaces/auth0clientoptions.html#connection","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"Auth0ClientOptions"},{"id":19,"kind":256,"name":"RedirectLoginOptions","url":"interfaces/redirectloginoptions.html","classes":"tsd-kind-interface"},{"id":20,"kind":1024,"name":"redirect_uri","url":"interfaces/redirectloginoptions.html#redirect_uri","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"RedirectLoginOptions"},{"id":21,"kind":1024,"name":"appState","url":"interfaces/redirectloginoptions.html#appstate","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"RedirectLoginOptions"},{"id":22,"kind":1024,"name":"fragment","url":"interfaces/redirectloginoptions.html#fragment","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"RedirectLoginOptions"},{"id":23,"kind":1024,"name":"display","url":"interfaces/redirectloginoptions.html#display","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"RedirectLoginOptions"},{"id":24,"kind":1024,"name":"prompt","url":"interfaces/redirectloginoptions.html#prompt","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"RedirectLoginOptions"},{"id":25,"kind":1024,"name":"max_age","url":"interfaces/redirectloginoptions.html#max_age","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"RedirectLoginOptions"},{"id":26,"kind":1024,"name":"ui_locales","url":"interfaces/redirectloginoptions.html#ui_locales","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"RedirectLoginOptions"},{"id":27,"kind":1024,"name":"id_token_hint","url":"interfaces/redirectloginoptions.html#id_token_hint","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"RedirectLoginOptions"},{"id":28,"kind":1024,"name":"login_hint","url":"interfaces/redirectloginoptions.html#login_hint","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"RedirectLoginOptions"},{"id":29,"kind":1024,"name":"acr_values","url":"interfaces/redirectloginoptions.html#acr_values","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"RedirectLoginOptions"},{"id":30,"kind":1024,"name":"scope","url":"interfaces/redirectloginoptions.html#scope","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"RedirectLoginOptions"},{"id":31,"kind":1024,"name":"audience","url":"interfaces/redirectloginoptions.html#audience","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"RedirectLoginOptions"},{"id":32,"kind":1024,"name":"connection","url":"interfaces/redirectloginoptions.html#connection","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"RedirectLoginOptions"},{"id":33,"kind":256,"name":"RedirectLoginResult","url":"interfaces/redirectloginresult.html","classes":"tsd-kind-interface"},{"id":34,"kind":1024,"name":"appState","url":"interfaces/redirectloginresult.html#appstate","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"RedirectLoginResult"},{"id":35,"kind":256,"name":"PopupLoginOptions","url":"interfaces/popuploginoptions.html","classes":"tsd-kind-interface"},{"id":36,"kind":1024,"name":"display","url":"interfaces/popuploginoptions.html#display","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"PopupLoginOptions"},{"id":37,"kind":1024,"name":"prompt","url":"interfaces/popuploginoptions.html#prompt","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"PopupLoginOptions"},{"id":38,"kind":1024,"name":"max_age","url":"interfaces/popuploginoptions.html#max_age","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"PopupLoginOptions"},{"id":39,"kind":1024,"name":"ui_locales","url":"interfaces/popuploginoptions.html#ui_locales","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"PopupLoginOptions"},{"id":40,"kind":1024,"name":"id_token_hint","url":"interfaces/popuploginoptions.html#id_token_hint","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"PopupLoginOptions"},{"id":41,"kind":1024,"name":"login_hint","url":"interfaces/popuploginoptions.html#login_hint","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"PopupLoginOptions"},{"id":42,"kind":1024,"name":"acr_values","url":"interfaces/popuploginoptions.html#acr_values","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"PopupLoginOptions"},{"id":43,"kind":1024,"name":"scope","url":"interfaces/popuploginoptions.html#scope","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"PopupLoginOptions"},{"id":44,"kind":1024,"name":"audience","url":"interfaces/popuploginoptions.html#audience","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"PopupLoginOptions"},{"id":45,"kind":1024,"name":"connection","url":"interfaces/popuploginoptions.html#connection","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"PopupLoginOptions"},{"id":46,"kind":256,"name":"PopupConfigOptions","url":"interfaces/popupconfigoptions.html","classes":"tsd-kind-interface"},{"id":47,"kind":1024,"name":"timeoutInSeconds","url":"interfaces/popupconfigoptions.html#timeoutinseconds","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PopupConfigOptions"},{"id":48,"kind":1024,"name":"popup","url":"interfaces/popupconfigoptions.html#popup","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PopupConfigOptions"},{"id":49,"kind":256,"name":"GetUserOptions","url":"interfaces/getuseroptions.html","classes":"tsd-kind-interface"},{"id":50,"kind":1024,"name":"scope","url":"interfaces/getuseroptions.html#scope","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"GetUserOptions"},{"id":51,"kind":1024,"name":"audience","url":"interfaces/getuseroptions.html#audience","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"GetUserOptions"},{"id":52,"kind":256,"name":"GetIdTokenClaimsOptions","url":"interfaces/getidtokenclaimsoptions.html","classes":"tsd-kind-interface"},{"id":53,"kind":1024,"name":"scope","url":"interfaces/getidtokenclaimsoptions.html#scope","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"GetIdTokenClaimsOptions"},{"id":54,"kind":1024,"name":"audience","url":"interfaces/getidtokenclaimsoptions.html#audience","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"GetIdTokenClaimsOptions"},{"id":55,"kind":256,"name":"GetTokenSilentlyOptions","url":"interfaces/gettokensilentlyoptions.html","classes":"tsd-kind-interface"},{"id":56,"kind":1024,"name":"ignoreCache","url":"interfaces/gettokensilentlyoptions.html#ignorecache","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"GetTokenSilentlyOptions"},{"id":57,"kind":1024,"name":"redirect_uri","url":"interfaces/gettokensilentlyoptions.html#redirect_uri","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"GetTokenSilentlyOptions"},{"id":58,"kind":1024,"name":"scope","url":"interfaces/gettokensilentlyoptions.html#scope","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"GetTokenSilentlyOptions"},{"id":59,"kind":1024,"name":"audience","url":"interfaces/gettokensilentlyoptions.html#audience","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"GetTokenSilentlyOptions"},{"id":60,"kind":1024,"name":"timeoutInSeconds","url":"interfaces/gettokensilentlyoptions.html#timeoutinseconds","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"GetTokenSilentlyOptions"},{"id":61,"kind":256,"name":"GetTokenWithPopupOptions","url":"interfaces/gettokenwithpopupoptions.html","classes":"tsd-kind-interface"},{"id":62,"kind":1024,"name":"display","url":"interfaces/gettokenwithpopupoptions.html#display","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"GetTokenWithPopupOptions"},{"id":63,"kind":1024,"name":"prompt","url":"interfaces/gettokenwithpopupoptions.html#prompt","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"GetTokenWithPopupOptions"},{"id":64,"kind":1024,"name":"max_age","url":"interfaces/gettokenwithpopupoptions.html#max_age","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"GetTokenWithPopupOptions"},{"id":65,"kind":1024,"name":"ui_locales","url":"interfaces/gettokenwithpopupoptions.html#ui_locales","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"GetTokenWithPopupOptions"},{"id":66,"kind":1024,"name":"id_token_hint","url":"interfaces/gettokenwithpopupoptions.html#id_token_hint","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"GetTokenWithPopupOptions"},{"id":67,"kind":1024,"name":"login_hint","url":"interfaces/gettokenwithpopupoptions.html#login_hint","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"GetTokenWithPopupOptions"},{"id":68,"kind":1024,"name":"acr_values","url":"interfaces/gettokenwithpopupoptions.html#acr_values","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"GetTokenWithPopupOptions"},{"id":69,"kind":1024,"name":"scope","url":"interfaces/gettokenwithpopupoptions.html#scope","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"GetTokenWithPopupOptions"},{"id":70,"kind":1024,"name":"audience","url":"interfaces/gettokenwithpopupoptions.html#audience","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"GetTokenWithPopupOptions"},{"id":71,"kind":1024,"name":"connection","url":"interfaces/gettokenwithpopupoptions.html#connection","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"GetTokenWithPopupOptions"},{"id":72,"kind":256,"name":"LogoutOptions","url":"interfaces/logoutoptions.html","classes":"tsd-kind-interface"},{"id":73,"kind":1024,"name":"returnTo","url":"interfaces/logoutoptions.html#returnto","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"LogoutOptions"},{"id":74,"kind":1024,"name":"client_id","url":"interfaces/logoutoptions.html#client_id","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"LogoutOptions"},{"id":75,"kind":1024,"name":"federated","url":"interfaces/logoutoptions.html#federated","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"LogoutOptions"},{"id":76,"kind":1024,"name":"localOnly","url":"interfaces/logoutoptions.html#localonly","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"LogoutOptions"},{"id":77,"kind":4194304,"name":"CacheLocation","url":"globals.html#cachelocation","classes":"tsd-kind-type-alias"},{"id":78,"kind":4194304,"name":"getIdTokenClaimsOptions","url":"globals.html#getidtokenclaimsoptions","classes":"tsd-kind-type-alias"},{"id":79,"kind":32,"name":"CACHE_LOCATION_MEMORY","url":"globals.html#cache_location_memory","classes":"tsd-kind-variable"},{"id":80,"kind":32,"name":"CACHE_LOCATION_LOCAL_STORAGE","url":"globals.html#cache_location_local_storage","classes":"tsd-kind-variable"},{"id":81,"kind":32,"name":"MISSING_REFRESH_TOKEN_ERROR_MESSAGE","url":"globals.html#missing_refresh_token_error_message","classes":"tsd-kind-variable"},{"id":82,"kind":128,"name":"GenericError","url":"classes/genericerror.html","classes":"tsd-kind-class"},{"id":83,"kind":512,"name":"constructor","url":"classes/genericerror.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"GenericError"},{"id":84,"kind":1024,"name":"error","url":"classes/genericerror.html#error","classes":"tsd-kind-property tsd-parent-kind-class","parent":"GenericError"},{"id":85,"kind":1024,"name":"error_description","url":"classes/genericerror.html#error_description","classes":"tsd-kind-property tsd-parent-kind-class","parent":"GenericError"},{"id":86,"kind":1024,"name":"name","url":"classes/genericerror.html#name","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited","parent":"GenericError"},{"id":87,"kind":1024,"name":"message","url":"classes/genericerror.html#message","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited","parent":"GenericError"},{"id":88,"kind":1024,"name":"stack","url":"classes/genericerror.html#stack","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-overwrite tsd-is-inherited","parent":"GenericError"},{"id":89,"kind":1024,"name":"Error","url":"classes/genericerror.html#error-1","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-static","parent":"GenericError"},{"id":90,"kind":128,"name":"AuthenticationError","url":"classes/authenticationerror.html","classes":"tsd-kind-class"},{"id":91,"kind":512,"name":"constructor","url":"classes/authenticationerror.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite","parent":"AuthenticationError"},{"id":92,"kind":1024,"name":"state","url":"classes/authenticationerror.html#state","classes":"tsd-kind-property tsd-parent-kind-class","parent":"AuthenticationError"},{"id":93,"kind":1024,"name":"appState","url":"classes/authenticationerror.html#appstate","classes":"tsd-kind-property tsd-parent-kind-class","parent":"AuthenticationError"},{"id":94,"kind":1024,"name":"error","url":"classes/authenticationerror.html#error","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited","parent":"AuthenticationError"},{"id":95,"kind":1024,"name":"error_description","url":"classes/authenticationerror.html#error_description","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited","parent":"AuthenticationError"},{"id":96,"kind":1024,"name":"name","url":"classes/authenticationerror.html#name","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited","parent":"AuthenticationError"},{"id":97,"kind":1024,"name":"message","url":"classes/authenticationerror.html#message","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited","parent":"AuthenticationError"},{"id":98,"kind":1024,"name":"stack","url":"classes/authenticationerror.html#stack","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited","parent":"AuthenticationError"},{"id":99,"kind":128,"name":"Auth0Client","url":"classes/auth0client.html","classes":"tsd-kind-class"},{"id":100,"kind":1024,"name":"cacheLocation","url":"classes/auth0client.html#cachelocation","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Auth0Client"},{"id":101,"kind":512,"name":"constructor","url":"classes/auth0client.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"Auth0Client"},{"id":102,"kind":2048,"name":"buildAuthorizeUrl","url":"classes/auth0client.html#buildauthorizeurl","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Auth0Client"},{"id":103,"kind":2048,"name":"loginWithPopup","url":"classes/auth0client.html#loginwithpopup","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Auth0Client"},{"id":104,"kind":2048,"name":"getUser","url":"classes/auth0client.html#getuser","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Auth0Client"},{"id":105,"kind":2048,"name":"getIdTokenClaims","url":"classes/auth0client.html#getidtokenclaims","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Auth0Client"},{"id":106,"kind":2048,"name":"loginWithRedirect","url":"classes/auth0client.html#loginwithredirect","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Auth0Client"},{"id":107,"kind":2048,"name":"handleRedirectCallback","url":"classes/auth0client.html#handleredirectcallback","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Auth0Client"},{"id":108,"kind":2048,"name":"getTokenSilently","url":"classes/auth0client.html#gettokensilently","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Auth0Client"},{"id":109,"kind":2048,"name":"getTokenWithPopup","url":"classes/auth0client.html#gettokenwithpopup","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Auth0Client"},{"id":110,"kind":2048,"name":"isAuthenticated","url":"classes/auth0client.html#isauthenticated","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Auth0Client"},{"id":111,"kind":2048,"name":"logout","url":"classes/auth0client.html#logout","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Auth0Client"},{"id":112,"kind":64,"name":"createAuth0Client","url":"globals.html#createauth0client","classes":"tsd-kind-function"}],"index":{"version":"2.3.8","fields":["name","parent"],"fieldVectors":[["name/0",[0,17.658]],["parent/0",[]],["name/1",[1,43.307]],["parent/1",[0,1.631]],["name/2",[2,43.307]],["parent/2",[0,1.631]],["name/3",[3,38.199]],["parent/3",[0,1.631]],["name/4",[4,34.834]],["parent/4",[0,1.631]],["name/5",[5,43.307]],["parent/5",[0,1.631]],["name/6",[6,34.834]],["parent/6",[0,1.631]],["name/7",[7,43.307]],["parent/7",[0,1.631]],["name/8",[8,43.307]],["parent/8",[0,1.631]],["name/9",[9,32.321]],["parent/9",[0,1.631]],["name/10",[10,32.321]],["parent/10",[0,1.631]],["name/11",[11,32.321]],["parent/11",[0,1.631]],["name/12",[12,32.321]],["parent/12",[0,1.631]],["name/13",[13,32.321]],["parent/13",[0,1.631]],["name/14",[14,32.321]],["parent/14",[0,1.631]],["name/15",[15,32.321]],["parent/15",[0,1.631]],["name/16",[16,27.213]],["parent/16",[0,1.631]],["name/17",[17,27.213]],["parent/17",[0,1.631]],["name/18",[18,32.321]],["parent/18",[0,1.631]],["name/19",[19,20.62]],["parent/19",[]],["name/20",[4,34.834]],["parent/20",[19,1.905]],["name/21",[20,34.834]],["parent/21",[19,1.905]],["name/22",[21,43.307]],["parent/22",[19,1.905]],["name/23",[9,32.321]],["parent/23",[19,1.905]],["name/24",[10,32.321]],["parent/24",[19,1.905]],["name/25",[11,32.321]],["parent/25",[19,1.905]],["name/26",[12,32.321]],["parent/26",[19,1.905]],["name/27",[13,32.321]],["parent/27",[19,1.905]],["name/28",[14,32.321]],["parent/28",[19,1.905]],["name/29",[15,32.321]],["parent/29",[19,1.905]],["name/30",[16,27.213]],["parent/30",[19,1.905]],["name/31",[17,27.213]],["parent/31",[19,1.905]],["name/32",[18,32.321]],["parent/32",[19,1.905]],["name/33",[22,38.199]],["parent/33",[]],["name/34",[20,34.834]],["parent/34",[22,3.528]],["name/35",[23,22.939]],["parent/35",[]],["name/36",[9,32.321]],["parent/36",[23,2.119]],["name/37",[10,32.321]],["parent/37",[23,2.119]],["name/38",[11,32.321]],["parent/38",[23,2.119]],["name/39",[12,32.321]],["parent/39",[23,2.119]],["name/40",[13,32.321]],["parent/40",[23,2.119]],["name/41",[14,32.321]],["parent/41",[23,2.119]],["name/42",[15,32.321]],["parent/42",[23,2.119]],["name/43",[16,27.213]],["parent/43",[23,2.119]],["name/44",[17,27.213]],["parent/44",[23,2.119]],["name/45",[18,32.321]],["parent/45",[23,2.119]],["name/46",[24,34.834]],["parent/46",[]],["name/47",[25,38.199]],["parent/47",[24,3.217]],["name/48",[26,43.307]],["parent/48",[24,3.217]],["name/49",[27,34.834]],["parent/49",[]],["name/50",[16,27.213]],["parent/50",[27,3.217]],["name/51",[17,27.213]],["parent/51",[27,3.217]],["name/52",[28,32.321]],["parent/52",[]],["name/53",[16,27.213]],["parent/53",[28,2.985]],["name/54",[17,27.213]],["parent/54",[28,2.985]],["name/55",[29,28.644]],["parent/55",[]],["name/56",[30,43.307]],["parent/56",[29,2.646]],["name/57",[4,34.834]],["parent/57",[29,2.646]],["name/58",[16,27.213]],["parent/58",[29,2.646]],["name/59",[17,27.213]],["parent/59",[29,2.646]],["name/60",[25,38.199]],["parent/60",[29,2.646]],["name/61",[31,22.939]],["parent/61",[]],["name/62",[9,32.321]],["parent/62",[31,2.119]],["name/63",[10,32.321]],["parent/63",[31,2.119]],["name/64",[11,32.321]],["parent/64",[31,2.119]],["name/65",[12,32.321]],["parent/65",[31,2.119]],["name/66",[13,32.321]],["parent/66",[31,2.119]],["name/67",[14,32.321]],["parent/67",[31,2.119]],["name/68",[15,32.321]],["parent/68",[31,2.119]],["name/69",[16,27.213]],["parent/69",[31,2.119]],["name/70",[17,27.213]],["parent/70",[31,2.119]],["name/71",[18,32.321]],["parent/71",[31,2.119]],["name/72",[32,30.315]],["parent/72",[]],["name/73",[33,43.307]],["parent/73",[32,2.8]],["name/74",[3,38.199]],["parent/74",[32,2.8]],["name/75",[34,43.307]],["parent/75",[32,2.8]],["name/76",[35,43.307]],["parent/76",[32,2.8]],["name/77",[6,34.834]],["parent/77",[]],["name/78",[28,32.321]],["parent/78",[]],["name/79",[36,43.307]],["parent/79",[]],["name/80",[37,43.307]],["parent/80",[]],["name/81",[38,43.307]],["parent/81",[]],["name/82",[39,25.961]],["parent/82",[]],["name/83",[40,34.834]],["parent/83",[39,2.398]],["name/84",[41,34.834]],["parent/84",[39,2.398]],["name/85",[42,38.199]],["parent/85",[39,2.398]],["name/86",[43,38.199]],["parent/86",[39,2.398]],["name/87",[44,38.199]],["parent/87",[39,2.398]],["name/88",[45,38.199]],["parent/88",[39,2.398]],["name/89",[41,34.834]],["parent/89",[39,2.398]],["name/90",[46,24.849]],["parent/90",[]],["name/91",[40,34.834]],["parent/91",[46,2.295]],["name/92",[47,43.307]],["parent/92",[46,2.295]],["name/93",[20,34.834]],["parent/93",[46,2.295]],["name/94",[41,34.834]],["parent/94",[46,2.295]],["name/95",[42,38.199]],["parent/95",[46,2.295]],["name/96",[43,38.199]],["parent/96",[46,2.295]],["name/97",[44,38.199]],["parent/97",[46,2.295]],["name/98",[45,38.199]],["parent/98",[46,2.295]],["name/99",[48,21.335]],["parent/99",[]],["name/100",[6,34.834]],["parent/100",[48,1.971]],["name/101",[40,34.834]],["parent/101",[48,1.971]],["name/102",[49,43.307]],["parent/102",[48,1.971]],["name/103",[50,43.307]],["parent/103",[48,1.971]],["name/104",[51,43.307]],["parent/104",[48,1.971]],["name/105",[52,43.307]],["parent/105",[48,1.971]],["name/106",[53,43.307]],["parent/106",[48,1.971]],["name/107",[54,43.307]],["parent/107",[48,1.971]],["name/108",[55,43.307]],["parent/108",[48,1.971]],["name/109",[56,43.307]],["parent/109",[48,1.971]],["name/110",[57,43.307]],["parent/110",[48,1.971]],["name/111",[58,43.307]],["parent/111",[48,1.971]],["name/112",[59,43.307]],["parent/112",[]]],"invertedIndex":[["acr_values",{"_index":15,"name":{"15":{},"29":{},"42":{},"68":{}},"parent":{}}],["appstate",{"_index":20,"name":{"21":{},"34":{},"93":{}},"parent":{}}],["audience",{"_index":17,"name":{"17":{},"31":{},"44":{},"51":{},"54":{},"59":{},"70":{}},"parent":{}}],["auth0client",{"_index":48,"name":{"99":{}},"parent":{"100":{},"101":{},"102":{},"103":{},"104":{},"105":{},"106":{},"107":{},"108":{},"109":{},"110":{},"111":{}}}],["auth0clientoptions",{"_index":0,"name":{"0":{}},"parent":{"1":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{}}}],["authenticationerror",{"_index":46,"name":{"90":{}},"parent":{"91":{},"92":{},"93":{},"94":{},"95":{},"96":{},"97":{},"98":{}}}],["authorizetimeoutinseconds",{"_index":8,"name":{"8":{}},"parent":{}}],["buildauthorizeurl",{"_index":49,"name":{"102":{}},"parent":{}}],["cache_location_local_storage",{"_index":37,"name":{"80":{}},"parent":{}}],["cache_location_memory",{"_index":36,"name":{"79":{}},"parent":{}}],["cachelocation",{"_index":6,"name":{"6":{},"77":{},"100":{}},"parent":{}}],["client_id",{"_index":3,"name":{"3":{},"74":{}},"parent":{}}],["connection",{"_index":18,"name":{"18":{},"32":{},"45":{},"71":{}},"parent":{}}],["constructor",{"_index":40,"name":{"83":{},"91":{},"101":{}},"parent":{}}],["createauth0client",{"_index":59,"name":{"112":{}},"parent":{}}],["display",{"_index":9,"name":{"9":{},"23":{},"36":{},"62":{}},"parent":{}}],["domain",{"_index":1,"name":{"1":{}},"parent":{}}],["error",{"_index":41,"name":{"84":{},"89":{},"94":{}},"parent":{}}],["error_description",{"_index":42,"name":{"85":{},"95":{}},"parent":{}}],["federated",{"_index":34,"name":{"75":{}},"parent":{}}],["fragment",{"_index":21,"name":{"22":{}},"parent":{}}],["genericerror",{"_index":39,"name":{"82":{}},"parent":{"83":{},"84":{},"85":{},"86":{},"87":{},"88":{},"89":{}}}],["getidtokenclaims",{"_index":52,"name":{"105":{}},"parent":{}}],["getidtokenclaimsoptions",{"_index":28,"name":{"52":{},"78":{}},"parent":{"53":{},"54":{}}}],["gettokensilently",{"_index":55,"name":{"108":{}},"parent":{}}],["gettokensilentlyoptions",{"_index":29,"name":{"55":{}},"parent":{"56":{},"57":{},"58":{},"59":{},"60":{}}}],["gettokenwithpopup",{"_index":56,"name":{"109":{}},"parent":{}}],["gettokenwithpopupoptions",{"_index":31,"name":{"61":{}},"parent":{"62":{},"63":{},"64":{},"65":{},"66":{},"67":{},"68":{},"69":{},"70":{},"71":{}}}],["getuser",{"_index":51,"name":{"104":{}},"parent":{}}],["getuseroptions",{"_index":27,"name":{"49":{}},"parent":{"50":{},"51":{}}}],["handleredirectcallback",{"_index":54,"name":{"107":{}},"parent":{}}],["id_token_hint",{"_index":13,"name":{"13":{},"27":{},"40":{},"66":{}},"parent":{}}],["ignorecache",{"_index":30,"name":{"56":{}},"parent":{}}],["isauthenticated",{"_index":57,"name":{"110":{}},"parent":{}}],["issuer",{"_index":2,"name":{"2":{}},"parent":{}}],["leeway",{"_index":5,"name":{"5":{}},"parent":{}}],["localonly",{"_index":35,"name":{"76":{}},"parent":{}}],["login_hint",{"_index":14,"name":{"14":{},"28":{},"41":{},"67":{}},"parent":{}}],["loginwithpopup",{"_index":50,"name":{"103":{}},"parent":{}}],["loginwithredirect",{"_index":53,"name":{"106":{}},"parent":{}}],["logout",{"_index":58,"name":{"111":{}},"parent":{}}],["logoutoptions",{"_index":32,"name":{"72":{}},"parent":{"73":{},"74":{},"75":{},"76":{}}}],["max_age",{"_index":11,"name":{"11":{},"25":{},"38":{},"64":{}},"parent":{}}],["message",{"_index":44,"name":{"87":{},"97":{}},"parent":{}}],["missing_refresh_token_error_message",{"_index":38,"name":{"81":{}},"parent":{}}],["name",{"_index":43,"name":{"86":{},"96":{}},"parent":{}}],["popup",{"_index":26,"name":{"48":{}},"parent":{}}],["popupconfigoptions",{"_index":24,"name":{"46":{}},"parent":{"47":{},"48":{}}}],["popuploginoptions",{"_index":23,"name":{"35":{}},"parent":{"36":{},"37":{},"38":{},"39":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{}}}],["prompt",{"_index":10,"name":{"10":{},"24":{},"37":{},"63":{}},"parent":{}}],["redirect_uri",{"_index":4,"name":{"4":{},"20":{},"57":{}},"parent":{}}],["redirectloginoptions",{"_index":19,"name":{"19":{}},"parent":{"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"30":{},"31":{},"32":{}}}],["redirectloginresult",{"_index":22,"name":{"33":{}},"parent":{"34":{}}}],["returnto",{"_index":33,"name":{"73":{}},"parent":{}}],["scope",{"_index":16,"name":{"16":{},"30":{},"43":{},"50":{},"53":{},"58":{},"69":{}},"parent":{}}],["stack",{"_index":45,"name":{"88":{},"98":{}},"parent":{}}],["state",{"_index":47,"name":{"92":{}},"parent":{}}],["timeoutinseconds",{"_index":25,"name":{"47":{},"60":{}},"parent":{}}],["ui_locales",{"_index":12,"name":{"12":{},"26":{},"39":{},"65":{}},"parent":{}}],["userefreshtokens",{"_index":7,"name":{"7":{}},"parent":{}}]],"pipeline":[]}} \ No newline at end of file diff --git a/docs/classes/auth0client.html b/docs/classes/auth0client.html index b01e5be06..05fcc6c1b 100644 --- a/docs/classes/auth0client.html +++ b/docs/classes/auth0client.html @@ -2809,6 +2809,9 @@
getIdTokenClaims
getIdTokenClaims
Parameters
Default value options: GetIdTokenClaimsOptions = {audience: this.options.audience || 'default',scope: this.options.scope || this.DEFAULT_SCOPE}
+Default value options: GetIdTokenClaimsOptions = {audience: this.options.audience || 'default',scope: this.options.scope || this.DEFAULT_SCOPE,}
getTokenSilently
getTokenSilently
as arguments. Random and securestate
andnonce
parameters will be auto-generated. If the response is successful, results will be valid according to their expiration times. +If refresh tokens are used, the token endpoint is called directly with the + 'refresh_token' grant. If no refresh token is available to make this call, + the SDK falls back to using an iframe to the '/authorize' URL.
+This method may use a web worker to perform the token call if the in-memory + cache is used.
+If an
+audience
value is given to this function, the SDK always falls + back to using an iframe to make the token exchange.Note that in all cases, falling back to an iframe requires access to + the
auth0
cookie.Parameters
@@ -3015,7 +3027,7 @@-
@@ -3030,7 +3042,7 @@ -
-
@@ -3052,7 +3064,7 @@ -
@@ -3065,7 +3077,7 @@ -
-
@@ -3084,7 +3096,7 @@ -
@@ -3115,7 +3127,7 @@ -
@@ -3139,7 +3151,7 @@ -
@@ -3179,7 +3191,7 @@ -
@@ -3212,7 +3224,7 @@ -
diff --git a/docs/classes/authenticationerror.html b/docs/classes/authenticationerror.html
index 31246f4f8..8980698fd 100644
--- a/docs/classes/authenticationerror.html
+++ b/docs/classes/authenticationerror.html
@@ -2797,6 +2797,9 @@
-
CACHE_
LOCATION_MEMORY
+ -
+ MISSING_
REFRESH_TOKEN_ERROR_MESSAGE
+
-
create
Auth0Client
@@ -2855,7 +2858,7 @@ appState: any
@@ -2897,7 +2900,7 @@ state: string
diff --git a/docs/classes/genericerror.html b/docs/classes/genericerror.html
index 47303c746..65755ddee 100644
--- a/docs/classes/genericerror.html
+++ b/docs/classes/genericerror.html
@@ -2794,6 +2794,9 @@
-
CACHE_
LOCATION_MEMORY
+ -
+ MISSING_
REFRESH_TOKEN_ERROR_MESSAGE
+
-
create
Auth0Client
@@ -2855,7 +2858,7 @@ -
error: string
@@ -2890,7 +2893,7 @@ error_description: string
diff --git a/docs/globals.html b/docs/globals.html
index a6f7214ac..27c3cf46d 100644
--- a/docs/globals.html
+++ b/docs/globals.html
@@ -2771,6 +2771,9 @@
-
CACHE_
LOCATION_MEMORY
+ -
+ MISSING_
REFRESH_TOKEN_ERROR_MESSAGE
+
-
create
Auth0Client
@@ -2811,7 +2814,7 @@
- CACHE_
LOCATION_LOCAL_STORAGE
- CACHE_
LOCATION_MEMORY
+ - MISSING_
REFRESH_TOKEN_ERROR_MESSAGE
@@ -3047,7 +3064,7 @@ CacheLocation: "memory" | "localstorage"
@@ -3062,7 +3079,7 @@ getIdTokenClaimsOptions: GetIdTokenClaimsOptions
@@ -3075,7 +3092,7 @@
getTokenWithPopup
getTokenWithPopup
Parameters
Default value options: GetTokenWithPopupOptions = {audience: this.options.audience,scope: this.options.scope || this.DEFAULT_SCOPE}
+Default value options: GetTokenWithPopupOptions = {audience: this.options.audience,scope: this.options.scope || this.DEFAULT_SCOPE,}
getUser
getUser
Parameters
Default value options: GetUserOptions = {audience: this.options.audience || 'default',scope: this.options.scope || this.DEFAULT_SCOPE}
+Default value options: GetUserOptions = {audience: this.options.audience || 'default',scope: this.options.scope || this.DEFAULT_SCOPE,}
handleRedirectCallback
isAuthenticated
loginWithPopup
loginWithRedirect
logout
constructor
Parameters
@@ -2886,7 +2889,7 @@appState
error
@@ -2908,7 +2911,7 @@error_description
@@ -2951,7 +2954,7 @@state
constructor
Parameters
@@ -2880,7 +2883,7 @@error
error_description
Documentation
Installation
From the CDN:
-
+<script src="https://cdn.auth0.com/js/auth0-spa-js/1.7.0-beta.5/auth0-spa-js.production.js"></script>
<script src="https://cdn.auth0.com/js/auth0-spa-js/1.7/auth0-spa-js.production.js"></script>
Using npm:
Using yarn:
@@ -2829,25 +2832,27 @@Creating the client
const auth0 = await createAuth0Client({ domain: '<AUTH0_DOMAIN>', client_id: '<AUTH0_CLIENT_ID>', - redirect_uri: '<MY_CALLBACK_URL>' + redirect_uri: '<MY_CALLBACK_URL>', }); //with promises createAuth0Client({ domain: '<AUTH0_DOMAIN>', client_id: '<AUTH0_CLIENT_ID>', - redirect_uri: '<MY_CALLBACK_URL>' -}).then(auth0 => { + redirect_uri: '<MY_CALLBACK_URL>', +}).then((auth0) => { //... }); //or, you can just instantiate the client on it's own import { Auth0Client } from '@auth0/auth0-spa-js'; + const auth0 = new Auth0Client({ domain: '<AUTH0_DOMAIN>', client_id: '<AUTH0_CLIENT_ID>', - redirect_uri: '<MY_CALLBACK_URL>' + redirect_uri: '<MY_CALLBACK_URL>', }); + //if you do this, you'll need to check the session yourself try { await getTokenSilently(); @@ -2886,9 +2891,9 @@1 - Login
//in your callback route (<MY_CALLBACK_URL>) window.addEventListener('load', () => { - auth0.handleRedirectCallback().then(redirectResult => { + auth0.handleRedirectCallback().then((redirectResult) => { //logged in. you can get the user profile like this: - auth0.getUser().then(user => { + auth0.getUser().then((user) => { console.log(user); }); }); @@ -2903,8 +2908,8 @@2 - Calling an API
const result = await fetch('https://myapi.com', { method: 'GET', headers: { - Authorization: `Bearer ${accessToken}` - } + Authorization: `Bearer ${accessToken}`, + }, }); const data = await result.json(); console.log(data); @@ -2914,16 +2919,16 @@2 - Calling an API
document.getElementById('call-api').addEventListener('click', () => { auth0 .getTokenSilently() - .then(accessToken => + .then((accessToken) => fetch('https://myapi.com', { method: 'GET', headers: { - Authorization: `Bearer ${accessToken}` - } + Authorization: `Bearer ${accessToken}`, + }, }) ) - .then(result => result.json()) - .then(data => { + .then((result) => result.json()) + .then((data) => { console.log(data); }); }); @@ -2936,8 +2941,8 @@3 - Logout
document.getElementById('logout').addEventListener('click', () => { auth0.logout(); }); - -Data caching
+ +Data caching options
The SDK can be configured to cache ID tokens and access tokens either in memory or in local storage. The default is in memory. This setting can be controlled using the
cacheLocation
option when creating the Auth0 client.To use the in-memory mode, no additional options need are required as this is the default setting. To configure the SDK to cache data using local storage, set
@@ -2945,11 +2950,22 @@cacheLocation
as follows:Data caching
domain: '<AUTH0_DOMAIN>', client_id: '<AUTH0_CLIENT_ID>', redirect_uri: '<MY_CALLBACK_URL>', - cacheLocation: 'localstorage' // valid values are: 'memory' or 'localstorage' -}).then(auth0 => { - // ... + cacheLocation: 'localstorage', // valid values are: 'memory' or 'localstorage' });Important: This feature will allow the caching of data such as ID and access tokens to be stored in local storage. Exercising this option changes the security characteristics of your application and should not be used lightly. Extra care should be taken to mitigate against XSS attacks and minimize the risk of tokens being stolen from local storage.
+ +Refresh Tokens
+ +Refresh tokens can be used to request new access tokens. Read more about how our refresh tokens work for browser-based applications to help you decide whether or not you need to use them.
+To enable the use of refresh tokens, set the
+useRefreshTokens
option totrue
:
+await createAuth0Client({ + domain: '<AUTH0_DOMAIN>', + client_id: '<AUTH0_CLIENT_ID>', + redirect_uri: '<MY_CALLBACK_URL>', + useRefreshTokens: true, +});
Using this setting will cause the SDK to automatically send the
+offline_access
scope to the authorization server. Refresh tokens will then be used to exchange for new access tokens instead of using a hidden iframe, and calls the/oauth/token
endpoint directly. This means that the SDK does not rely on third-party cookies when using refresh tokens.Note This configuration option requires Rotating Refresh Tokens to be enabled for your Auth0 Tenant.
Contributing
@@ -3028,6 +3044,7 @@Variables
CacheLocation
getIdTokenClaimsOptions
Const CACHE_LOCATION_LO
CACHE_LOCATION_LOCAL_STORAGE: "localstorage" = "localstorage"
@@ -3085,7 +3102,17 @@
Const CACHE_LOCATION_ME
CACHE_LOCATION_MEMORY: "memory" = "memory"
+
+
+
+ MISSING_REFRESH_TOKEN_ERROR_MESSAGE: "The web worker is missing the refresh token" = "The web worker is missing the refresh token"
+
@@ -3102,7 +3129,7 @@ -
-
CACHE_
LOCATION_MEMORY
+ -
+ MISSING_
REFRESH_TOKEN_ERROR_MESSAGE
+
-
create
Auth0Client
@@ -2811,7 +2814,7 @@
- CACHE_
LOCATION_LOCAL_STORAGE
- CACHE_
LOCATION_MEMORY
+ - MISSING_
REFRESH_TOKEN_ERROR_MESSAGE
@@ -3048,7 +3065,7 @@ CacheLocation: "memory" | "localstorage"
@@ -3063,7 +3080,7 @@ getIdTokenClaimsOptions: GetIdTokenClaimsOptions
@@ -3076,7 +3093,7 @@
Const MISSING_REFRESH_TOKEN_ERROR_MESSAGE
+createAuth0Client
Parameters
diff --git a/docs/index.html b/docs/index.html index 994cd552e..5c851f1ff 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2771,6 +2771,9 @@Documentation
Installation
From the CDN:
-
+<script src="https://cdn.auth0.com/js/auth0-spa-js/1.7.0-beta.5/auth0-spa-js.production.js"></script>
<script src="https://cdn.auth0.com/js/auth0-spa-js/1.7/auth0-spa-js.production.js"></script>
Using npm:
Using yarn:
@@ -2829,25 +2832,27 @@Creating the client
const auth0 = await createAuth0Client({ domain: '<AUTH0_DOMAIN>', client_id: '<AUTH0_CLIENT_ID>', - redirect_uri: '<MY_CALLBACK_URL>' + redirect_uri: '<MY_CALLBACK_URL>', }); //with promises createAuth0Client({ domain: '<AUTH0_DOMAIN>', client_id: '<AUTH0_CLIENT_ID>', - redirect_uri: '<MY_CALLBACK_URL>' -}).then(auth0 => { + redirect_uri: '<MY_CALLBACK_URL>', +}).then((auth0) => { //... }); //or, you can just instantiate the client on it's own import { Auth0Client } from '@auth0/auth0-spa-js'; + const auth0 = new Auth0Client({ domain: '<AUTH0_DOMAIN>', client_id: '<AUTH0_CLIENT_ID>', - redirect_uri: '<MY_CALLBACK_URL>' + redirect_uri: '<MY_CALLBACK_URL>', }); + //if you do this, you'll need to check the session yourself try { await getTokenSilently(); @@ -2886,9 +2891,9 @@1 - Login
//in your callback route (<MY_CALLBACK_URL>) window.addEventListener('load', () => { - auth0.handleRedirectCallback().then(redirectResult => { + auth0.handleRedirectCallback().then((redirectResult) => { //logged in. you can get the user profile like this: - auth0.getUser().then(user => { + auth0.getUser().then((user) => { console.log(user); }); }); @@ -2903,8 +2908,8 @@2 - Calling an API
const result = await fetch('https://myapi.com', { method: 'GET', headers: { - Authorization: `Bearer ${accessToken}` - } + Authorization: `Bearer ${accessToken}`, + }, }); const data = await result.json(); console.log(data); @@ -2914,16 +2919,16 @@2 - Calling an API
document.getElementById('call-api').addEventListener('click', () => { auth0 .getTokenSilently() - .then(accessToken => + .then((accessToken) => fetch('https://myapi.com', { method: 'GET', headers: { - Authorization: `Bearer ${accessToken}` - } + Authorization: `Bearer ${accessToken}`, + }, }) ) - .then(result => result.json()) - .then(data => { + .then((result) => result.json()) + .then((data) => { console.log(data); }); }); @@ -2936,8 +2941,8 @@3 - Logout
document.getElementById('logout').addEventListener('click', () => { auth0.logout(); }); - -Data caching
+ +Data caching options
The SDK can be configured to cache ID tokens and access tokens either in memory or in local storage. The default is in memory. This setting can be controlled using the
cacheLocation
option when creating the Auth0 client.To use the in-memory mode, no additional options need are required as this is the default setting. To configure the SDK to cache data using local storage, set
@@ -2945,11 +2950,22 @@cacheLocation
as follows:Data caching
domain: '<AUTH0_DOMAIN>', client_id: '<AUTH0_CLIENT_ID>', redirect_uri: '<MY_CALLBACK_URL>', - cacheLocation: 'localstorage' // valid values are: 'memory' or 'localstorage' -}).then(auth0 => { - // ... + cacheLocation: 'localstorage', // valid values are: 'memory' or 'localstorage' });Important: This feature will allow the caching of data such as ID and access tokens to be stored in local storage. Exercising this option changes the security characteristics of your application and should not be used lightly. Extra care should be taken to mitigate against XSS attacks and minimize the risk of tokens being stolen from local storage.
+ +Refresh Tokens
+ +Refresh tokens can be used to request new access tokens. Read more about how our refresh tokens work for browser-based applications to help you decide whether or not you need to use them.
+To enable the use of refresh tokens, set the
+useRefreshTokens
option totrue
:
+await createAuth0Client({ + domain: '<AUTH0_DOMAIN>', + client_id: '<AUTH0_CLIENT_ID>', + redirect_uri: '<MY_CALLBACK_URL>', + useRefreshTokens: true, +});
Using this setting will cause the SDK to automatically send the
+offline_access
scope to the authorization server. Refresh tokens will then be used to exchange for new access tokens instead of using a hidden iframe, and calls the/oauth/token
endpoint directly. This means that the SDK does not rely on third-party cookies when using refresh tokens.Note This configuration option requires Rotating Refresh Tokens to be enabled for your Auth0 Tenant.
Contributing
@@ -3029,6 +3045,7 @@Variables
CacheLocation
getIdTokenClaimsOptions
Const CACHE_LOCATION_LO
CACHE_LOCATION_LOCAL_STORAGE: "localstorage" = "localstorage"
@@ -3086,7 +3103,17 @@
Const CACHE_LOCATION_ME
CACHE_LOCATION_MEMORY: "memory" = "memory"
+
+
+
+ MISSING_REFRESH_TOKEN_ERROR_MESSAGE: "The web worker is missing the refresh token" = "The web worker is missing the refresh token"
+
@@ -3103,7 +3130,7 @@ -
-
CACHE_
LOCATION_MEMORY
+ -
+ MISSING_
REFRESH_TOKEN_ERROR_MESSAGE
+
-
create
Auth0Client
@@ -2896,7 +2899,7 @@
@@ -2922,7 +2925,7 @@
Const MISSING_REFRESH_TOKEN_ERROR_MESSAGE
+createAuth0Client
Parameters
diff --git a/docs/interfaces/auth0clientoptions.html b/docs/interfaces/auth0clientoptions.html index 8533eafa0..9559afc94 100644 --- a/docs/interfaces/auth0clientoptions.html +++ b/docs/interfaces/auth0clientoptions.html @@ -2827,6 +2827,9 @@Optional acr_values
@@ -2907,7 +2910,7 @@Optional audience
Optional authorizeTimeout
authorizeTimeoutInSeconds: number
@@ -2938,7 +2941,7 @@
@@ -2954,7 +2957,7 @@ client_id: string
@@ -2970,7 +2973,7 @@
@@ -2988,7 +2991,7 @@
@@ -3008,7 +3011,7 @@ domain: string
@@ -3026,7 +3029,7 @@
Optional cacheLocationcacheLocation: CacheLocation
client_id
Optional connection
Optional display
domain
Optional id_token_hi
@@ -3041,7 +3044,7 @@ issuer: string
@@ -3056,7 +3059,7 @@ leeway: number
@@ -3074,7 +3077,7 @@
@@ -3092,7 +3095,7 @@
@@ -3110,7 +3113,7 @@
@@ -3130,7 +3133,7 @@ uri: string
@@ -3150,7 +3153,7 @@
@@ -3167,7 +3170,7 @@
@@ -3183,7 +3186,7 @@
Optional issuer
Optional leeway
Optional login_hint
Optional max_age
Optional prompt
Optional redirect_uri
redirect_Optional scope
Optional ui_locales
Optional useRefreshT
useRefreshTokens: boolean
diff --git a/docs/interfaces/getidtokenclaimsoptions.html b/docs/interfaces/getidtokenclaimsoptions.html
index bea2ac3f4..d36e09e30 100644
--- a/docs/interfaces/getidtokenclaimsoptions.html
+++ b/docs/interfaces/getidtokenclaimsoptions.html
@@ -2779,6 +2779,9 @@
-
CACHE_
LOCATION_MEMORY
+ -
+ MISSING_
REFRESH_TOKEN_ERROR_MESSAGE
+
-
create
Auth0Client
@@ -2816,7 +2819,7 @@ audience: string
@@ -2831,7 +2834,7 @@ scope: string
diff --git a/docs/interfaces/gettokensilentlyoptions.html b/docs/interfaces/gettokensilentlyoptions.html
index bbefa60ac..1df01f27c 100644
--- a/docs/interfaces/gettokensilentlyoptions.html
+++ b/docs/interfaces/gettokensilentlyoptions.html
@@ -2788,6 +2788,9 @@
-
CACHE_
LOCATION_MEMORY
+ -
+ MISSING_
REFRESH_TOKEN_ERROR_MESSAGE
+
-
create
Auth0Client
@@ -2838,7 +2841,7 @@ audience: string
@@ -2853,7 +2856,7 @@ ignoreCache: boolean
@@ -2869,7 +2872,7 @@ uri: string
@@ -2889,7 +2892,7 @@ scope: string
@@ -2904,7 +2907,7 @@
audience
scope
Optional audience
Optional ignoreCache
Optional redirect_uri
redirect_Optional scope
Optional timeoutInSeconds
timeoutInSeconds: number
diff --git a/docs/interfaces/gettokenwithpopupoptions.html b/docs/interfaces/gettokenwithpopupoptions.html
index c4c817fd4..f173d30af 100644
--- a/docs/interfaces/gettokenwithpopupoptions.html
+++ b/docs/interfaces/gettokenwithpopupoptions.html
@@ -2803,6 +2803,9 @@
-
CACHE_
LOCATION_MEMORY
+ -
+ MISSING_
REFRESH_TOKEN_ERROR_MESSAGE
+
-
create
Auth0Client
@@ -2864,7 +2867,7 @@
@@ -2891,7 +2894,7 @@
@@ -2909,7 +2912,7 @@
@@ -2930,7 +2933,7 @@
Optional acr_values
@@ -2875,7 +2878,7 @@Optional audience
Optional connection
Optional display
Optional id_token_hi
@@ -2946,7 +2949,7 @@
@@ -2964,7 +2967,7 @@
@@ -2982,7 +2985,7 @@
@@ -3003,7 +3006,7 @@
@@ -3020,7 +3023,7 @@
diff --git a/docs/interfaces/getuseroptions.html b/docs/interfaces/getuseroptions.html
index 4ba5acfc7..56d8361e9 100644
--- a/docs/interfaces/getuseroptions.html
+++ b/docs/interfaces/getuseroptions.html
@@ -2779,6 +2779,9 @@
-
CACHE_
LOCATION_MEMORY
+ -
+ MISSING_
REFRESH_TOKEN_ERROR_MESSAGE
+
-
create
Auth0Client
@@ -2816,7 +2819,7 @@ audience: string
@@ -2831,7 +2834,7 @@ scope: string
diff --git a/docs/interfaces/logoutoptions.html b/docs/interfaces/logoutoptions.html
index 0b067d887..a410040f6 100644
--- a/docs/interfaces/logoutoptions.html
+++ b/docs/interfaces/logoutoptions.html
@@ -2785,6 +2785,9 @@
-
CACHE_
LOCATION_MEMORY
+ -
+ MISSING_
REFRESH_TOKEN_ERROR_MESSAGE
+
-
create
Auth0Client
@@ -2824,7 +2827,7 @@ client_id: string
@@ -2839,7 +2842,7 @@ federated: boolean
@@ -2858,7 +2861,7 @@ localOnly: boolean
@@ -2876,7 +2879,7 @@ returnTo: string
diff --git a/docs/interfaces/popupconfigoptions.html b/docs/interfaces/popupconfigoptions.html
index 60f18e0b4..933fa2319 100644
--- a/docs/interfaces/popupconfigoptions.html
+++ b/docs/interfaces/popupconfigoptions.html
@@ -2779,6 +2779,9 @@
-
CACHE_
LOCATION_MEMORY
+ -
+ MISSING_
REFRESH_TOKEN_ERROR_MESSAGE
+
-
create
Auth0Client
@@ -2816,7 +2819,7 @@ popup: any
@@ -2833,7 +2836,7 @@
Optional login_hint
Optional max_age
Optional prompt
Optional scope
Optional ui_locales
audience
scope
Optional client_id
Optional federated
Optional localOnly
Optional returnTo
Optional popup
Optional timeoutInSeconds
timeoutInSeconds: number
diff --git a/docs/interfaces/popuploginoptions.html b/docs/interfaces/popuploginoptions.html
index 625586e57..7071966dc 100644
--- a/docs/interfaces/popuploginoptions.html
+++ b/docs/interfaces/popuploginoptions.html
@@ -2803,6 +2803,9 @@
-
CACHE_
LOCATION_MEMORY
+ -
+ MISSING_
REFRESH_TOKEN_ERROR_MESSAGE
+
-
create
Auth0Client
@@ -2869,7 +2872,7 @@
@@ -2896,7 +2899,7 @@
@@ -2914,7 +2917,7 @@
@@ -2935,7 +2938,7 @@
Optional acr_values
@@ -2880,7 +2883,7 @@Optional audience
Optional connection
Optional display
Optional id_token_hi
@@ -2951,7 +2954,7 @@
@@ -2969,7 +2972,7 @@
@@ -2987,7 +2990,7 @@
@@ -3008,7 +3011,7 @@
@@ -3025,7 +3028,7 @@
diff --git a/docs/interfaces/redirectloginoptions.html b/docs/interfaces/redirectloginoptions.html
index 732e278bd..5a20eed12 100644
--- a/docs/interfaces/redirectloginoptions.html
+++ b/docs/interfaces/redirectloginoptions.html
@@ -2812,6 +2812,9 @@
-
CACHE_
LOCATION_MEMORY
+ -
+ MISSING_
REFRESH_TOKEN_ERROR_MESSAGE
+
-
create
Auth0Client
@@ -2876,7 +2879,7 @@ appState: any
@@ -2902,7 +2905,7 @@
@@ -2918,7 +2921,7 @@
@@ -2936,7 +2939,7 @@
@@ -2956,7 +2959,7 @@ fragment: string
@@ -2972,7 +2975,7 @@
Optional login_hint
Optional max_age
Optional prompt
Optional scope
Optional ui_locales
Optional acr_values
@@ -2886,7 +2889,7 @@Optional appState
Optional audience
Optional connection
Optional display
Optional fragment
Optional id_token_hi
@@ -2988,7 +2991,7 @@
@@ -3006,7 +3009,7 @@
@@ -3024,7 +3027,7 @@
@@ -3044,7 +3047,7 @@ uri: string
@@ -3063,7 +3066,7 @@
@@ -3080,7 +3083,7 @@
diff --git a/docs/interfaces/redirectloginresult.html b/docs/interfaces/redirectloginresult.html
index 856c3fba9..9d43b259a 100644
--- a/docs/interfaces/redirectloginresult.html
+++ b/docs/interfaces/redirectloginresult.html
@@ -2776,6 +2776,9 @@
-
CACHE_
LOCATION_MEMORY
+ -
+ MISSING_
REFRESH_TOKEN_ERROR_MESSAGE
+
-
create
Auth0Client
@@ -2812,7 +2815,7 @@ appState: any
diff --git a/package.json b/package.json
index 5b0622433..cd4357326 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"name": "@auth0/auth0-spa-js",
"description": "Auth0 SDK for Single Page Applications using Authorization Code Grant Flow with PKCE",
"license": "MIT",
- "version": "1.7.0-beta.5",
+ "version": "1.7.0",
"main": "dist/lib/auth0-spa-js.cjs.js",
"types": "dist/typings/index.d.ts",
"module": "dist/auth0-spa-js.production.esm.js",
diff --git a/src/Auth0Client.ts b/src/Auth0Client.ts
index aaa65acee..06e0d2c06 100644
--- a/src/Auth0Client.ts
+++ b/src/Auth0Client.ts
@@ -72,6 +72,9 @@ const cacheFactory = (location: string) => {
return cacheLocationBuilders[location];
};
+/**
+ * @ignore
+ */
const isIE11 = () => /Trident.*rv:11\.0/.test(navigator.userAgent);
/**
@@ -468,6 +471,19 @@ export default class Auth0Client {
* will be auto-generated. If the response is successful, results
* will be valid according to their expiration times.
*
+ * If refresh tokens are used, the token endpoint is called directly with the
+ * 'refresh_token' grant. If no refresh token is available to make this call,
+ * the SDK falls back to using an iframe to the '/authorize' URL.
+ *
+ * This method may use a web worker to perform the token call if the in-memory
+ * cache is used.
+ *
+ * If an `audience` value is given to this function, the SDK always falls
+ * back to using an iframe to make the token exchange.
+ *
+ * Note that in all cases, falling back to an iframe requires access to
+ * the `auth0` cookie.
+ *
* @param options
*/
public async getTokenSilently(options: GetTokenSilentlyOptions = {}) {
diff --git a/src/index.cjs.ts b/src/index.cjs.ts
index 7fcc3efe6..77d319d15 100644
--- a/src/index.cjs.ts
+++ b/src/index.cjs.ts
@@ -1,5 +1,8 @@
import createAuth0Client, { Auth0Client } from './index';
+/**
+ * @ignore
+ */
const wrapper = createAuth0Client as any;
wrapper.Auth0Client = Auth0Client;
diff --git a/src/token.worker.ts b/src/token.worker.ts
index 0849f52d5..473c0bf65 100644
--- a/src/token.worker.ts
+++ b/src/token.worker.ts
@@ -1,9 +1,18 @@
import { MISSING_REFRESH_TOKEN_ERROR_MESSAGE } from './constants';
+/**
+ * @ignore
+ */
let refreshToken;
+/**
+ * @ignore
+ */
const wait: any = (time) => new Promise((resolve) => setTimeout(resolve, time));
+/**
+ * @ignore
+ */
const messageHandler = async ({
data: { url, timeout, ...opts },
ports: [port],
diff --git a/src/version.ts b/src/version.ts
index e49582099..21cbde5eb 100644
--- a/src/version.ts
+++ b/src/version.ts
@@ -1 +1 @@
-export default '1.7.0-beta.5';
+export default '1.7.0';
Optional login_hint
Optional max_age
Optional prompt
Optional redirect_uri
redirect_Optional scope
Optional ui_locales
Optional appState