{"_id":"gsandf-auth0-js","_rev":"33-3a0d6f4f8ee21c8bd7cb74df9a25db3c","name":"gsandf-auth0-js","dist-tags":{"latest":"8.8.0"},"versions":{"8.8.0":{"name":"gsandf-auth0-js","version":"8.8.0","keywords":["auth0","auth","openid","authentication","jwt","browser"],"author":{"name":"Auth0"},"license":"MIT","_id":"gsandf-auth0-js@8.8.0","maintainers":[{"name":"williamhickok11","email":"williamhickok11@gmail.com"}],"homepage":"https://github.com/auth0/auth0.js#readme","bugs":{"url":"https://github.com/auth0/auth0.js/issues"},"dist":{"shasum":"aa2cc28ba255ecd20da30b98da27b7aa12321f8c","tarball":"https://registry.npmjs.org/gsandf-auth0-js/-/gsandf-auth0-js-8.8.0.tgz","integrity":"sha512-GMLdAdkdWbe92bBRD+hZ0JVJ2YOTk3ZasD7maDzfFIwiFRqTOyjiUkXRS8nTa6jKWFe+GgunS+/qlYJhuAZGQg==","signatures":[{"sig":"MEYCIQCQjJvAQqjoTIVM33N8ttQ3T5zsxzrgg1rMgx9jM+2QOgIhAOlY1dfcY+8ThUDVnZhOKLeQD1tW0mthd6VaQ9mhr09T","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"src/index.js","engine":{"node":">=6.9.0"},"gitHead":"620de1014f41b5b3e7981dc443507624c23ab38c","scripts":{"lint":"eslint ./src","test":"mocha test/**/*.test.js test/setup.js","build":"gulp build","start":"gulp dev","jsdocs":"jsdoc --configure .jsdoc.json --verbose","ci:test":"istanbul cover _mocha --report lcovonly -R test/**/* test/setup.js -- -R mocha-multi --reporter-options spec=-,mocha-junit-reporter=-","release":"scripts/release.sh","lint:fix":"eslint --fix ./src","precommit":"lint-staged","test:watch":"mocha --watch -R min test/**/*.test.js  test/setup.js","ci:coverage":"codecov","publish:cdn":"ccu","test:integration":"mocha-parallel-tests --max-parallel 2 integration/**/*.test.js"},"_npmUser":{"name":"williamhickok11","email":"williamhickok11@gmail.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git://github.com/auth0/auth0.js.git","type":"git"},"_npmVersion":"5.0.3","description":"Auth0 headless browser sdk","directories":{},"lint-staged":{"{src,test, plugins,integration}/**/*.js":["npm run lint","prettier --write --print-width 100 --single-quote","git add"]},"_nodeVersion":"8.1.3","browserslist":["last 2 versions","ie >= 9"],"dependencies":{"qs":"^6.4.0","winchan":"^0.2.0","url-join":"^1.1.0","base64-js":"^1.2.0","superagent":"^3.3.1","idtoken-verifier":"^1.1.0"},"cdn-component":{"cdn":"https://cdn.auth0.com","name":"auth0","bucket":"assets.us.auth0.com","localPath":"build","mainBundleFile":"auth0.min.js"},"devDependencies":{"gulp":"^3.9.1","husky":"^0.13.3","jsdoc":"^3.4.3","mocha":"^3.2.0","sinon":"^1.17.6","eslint":"3.12.2","minami":"^1.2.3","semver":"^5.3.0","codecov":"^1.0.1","webpack":"^1.13.2","istanbul":"^0.4.5","prettier":"^1.3.1","expect.js":"^0.2.0","gulp-util":"^3.0.7","lint-staged":"^3.4.2","mocha-multi":"^0.10.0","webpack-core":"^0.6.8","webpack-stream":"^3.2.0","jsdoc-to-markdown":"^2.0.1","selenium-webdriver":"^3.0.1","webpack-dev-server":"^1.16.2","eslint-plugin-compat":"^1.0.0","eslint-plugin-import":"1.16.0","mocha-junit-reporter":"^1.13.0","mocha-parallel-tests":"^1.2.5","component-cdn-uploader":"github:auth0/component-cdn-uploader#v1.3.0","eslint-config-prettier":"^2.1.0","webpack-hot-middleware":"^2.13.2","eslint-config-auth0-base":"6.0.0","unminified-webpack-plugin":"^1.1.1","smart-banner-webpack-plugin":"^2.0.0","webpack-custom-var-library-name-plugin":"^1.0.2"},"_npmOperationalInternal":{"tmp":"tmp/gsandf-auth0-js-8.8.0.tgz_1500405775632_0.2566556993406266","host":"s3://npm-registry-packages"}}},"time":{"created":"2017-07-18T19:22:57.314Z","modified":"2026-04-17T12:52:22.839Z","8.8.0":"2017-07-18T19:22:57.314Z"},"bugs":{"url":"https://github.com/auth0/auth0.js/issues"},"author":{"name":"Auth0"},"license":"MIT","homepage":"https://github.com/auth0/auth0.js#readme","keywords":["auth0","auth","openid","authentication","jwt","browser"],"repository":{"url":"git://github.com/auth0/auth0.js.git","type":"git"},"description":"Auth0 headless browser sdk","maintainers":[{"email":"mmcmains@gsandf.com","name":"meyer_mcmains"},{"email":"williamhickok11@gmail.com","name":"williamhickok11"}],"readme":"![](https://cdn.auth0.com/resources/oss-source-large-2x.png)\n\n# auth0.js\n\n[![Build Status][circleci-image]][circleci-url]\n[![NPM version][npm-image]][npm-url]\n[![Coverage][codecov-image]][codecov-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\nClient Side Javascript toolkit for Auth0 API\n\n> We recommend using auth0.js v8 if you need to use [API Auth](https://auth0.com/docs/api-auth) features. For auth0.js v7 code please check the [v7 branch](https://github.com/auth0/auth0.js/tree/v7), this version will be supported and maintained alongside v8.\n\nNeed help migrating from v7? Please check our [Migration Guide](https://auth0.com/docs/libraries/auth0js/v8/migration-guide)\n\n## Install\n\nFrom CDN\n\n```html\n<!-- Latest patch release (recommended for production) -->\n<script src=\"http://cdn.auth0.com/js/auth0/8.8.0/auth0.min.js\"></script>\n```\n\nFrom [bower](http://bower.io)\n\n```sh\nbower install auth0-lock\n```\n\n```html\n<script src=\"bower_components/auth0.js/build/auth0.min.js\"></script>\n```\n\nFrom [npm](https://npmjs.org)\n\n```sh\nnpm install auth0-js\n```\n\nAfter installing the `auth0-js` module, you'll need bundle it up along with all of its dependencies.\n\n## auth0.WebAuth\n\nProvides support for all the authentication flows\n\n### Initialize\n\n```js\nvar auth0 = new auth0.WebAuth({\n  domain: \"{YOUR_AUTH0_DOMAIN}\",\n  clientID: \"{YOUR_AUTH0_CLIENT_ID}\"\n});\n```\n\nParameters:\n- **domain {REQUIRED, string}**: Your Auth0 account domain such as `'example.auth0.com'` or `'example.eu.auth0.com'`.\n- **clientID {REQUIRED, string}**: Your Auth0 client ID.\n- **redirectUri {OPTIONAL, string}**: The URL where Auth0 will call back to with the result of a successful or failed authentication. It must be whitelisted in the \"Allowed Callback URLs\" in your Auth0 client's settings.\n- **scope {OPTIONAL, string}**: The default scope used for all authorization requests.\n- **audience {OPTIONAL, string}**: The default audience, used if requesting access to an API.\n- **responseType {OPTIONAL, string}**: Response type for all authentication requests. Defaults to `'token'`. Valid values are `'token'`, `'id_token'` and `'token id_token'`.\n- **responseMode {OPTIONAL, string}**: The default responseMode used, defaults to `'fragment'`. The `parseHash` method can be used to parse authentication responses using fragment response mode.\n- **_disableDeprecationWarnings {OPTIONAL, boolean}**: Disables the deprecation warnings, defaults to `false`.\n\n### API\n\n- **authorize(options)**: Redirects to the `/authorize` endpoint to start an authentication/authorization transaction.\nAuth0 will call back to your application with the results at the specified `redirectUri`.\n\n```js\nauth0.authorize({\n  audience: 'https://mystore.com/api/v2',\n  scope: 'read:order write:order',\n  responseType: 'token',\n  redirectUri: 'https://example.com/auth/callback'\n});\n```\n\n- **parseHash(options, callback)**: Parses a URL hash fragment to extract the result of an Auth0 authentication response.\n\n> This method requires that your tokens are signed with **RS256**. Please check our [Migration Guide](https://auth0.com/docs/libraries/auth0js/v8/migration-guide#switching-from-hs256-to-rs256) for more information.\n\n```js\nauth0.parseHash(window.location.hash, function(err, authResult) {\n  if (err) {\n    return console.log(err);\n  }\n\n  // The contents of authResult depend on which authentication parameters were used.\n  // It can include the following:\n  // authResult.accessToken - access token for the API specified by `audience`\n  // authResult.expiresIn - string with the access token's expiration time in seconds\n  // authResult.idToken - ID token JWT containing user profile information\n\n  auth0.client.userInfo(authResult.accessToken, function(err, user) {\n    // Now you have the user's information\n  });\n});\n```\n\n- **renewAuth(options, callback)**: Attempts to get a new token from Auth0 by using [silent authentication](https://auth0.com/docs/api-auth/tutorials/silent-authentication), or invokes `callback` with an error if the user does not have an active SSO session at your Auth0 domain.\n\nThis method can be used to detect a locally unauthenticated user's SSO session status, or to renew an authenticated user's access token.\nThe actual redirect to `/authorize` happens inside an iframe, so it will not reload your application or redirect away from it.\n\n```js\nauth0.renewAuth({\n  audience: 'https://mystore.com/api/v2',\n  scope: 'read:order write:order',\n  redirectUri: 'https://example.com/auth/silent-callback',\n\n  // this will use postMessage to comunicate between the silent callback\n  // and the SPA. When false the SDK will attempt to parse the url hash\n  // should ignore the url hash and no extra behaviour is needed.\n  usePostMessage: true\n  }, function (err, authResult) {\n    // Renewed tokens or error\n});\n```\n\nThe contents of `authResult` are identical to those returned by `parseHash()`.\nFor this request to succeed, the user must have an active SSO session at Auth0 by having logged in through the [hosted login page](https://manage.auth0.com/#/login_page) of your Auth0 domain.\n\n> ***Important:*** this will use postMessage to communicate between the silent callback and the SPA. When false the SDK will attempt to parse the url hash should ignore the url hash and no extra behaviour is needed.\n\n> **Also important:** If you're not using the hosted login page to do social logins, you have to use your own [social connection keys](https://manage.auth0.com/#/connections/social). If you use Auth0's dev keys, you'll always get `login_required` as an error when calling `renewAuth`.\n\nIt is strongly recommended to have a dedicated callback page for silent authentication in order to avoid loading your entire application again inside an iframe.\nThis callback page should only parse the URL hash and post it to the parent document so that your application can take action depending on the outcome of the silent authentication attempt.\nFor example:\n\n```js\n<!DOCTYPE html>\n<html>\n  <head>\n    <script src=\"/auth0.js\"></script>\n    <script type=\"text/javascript\">\n      var auth0 = new auth0.WebAuth({\n        domain: '{YOUR_AUTH0_DOMAIN}',\n        clientID: '{YOUR_AUTH0_CLIENT_ID}'\n      });\n      auth0.parseHash(window.location.hash, function (err, result) {\n        parent.postMessage(err || result, 'https://example.com/');\n      });\n    </script>\n  </head>\n  <body></body>\n</html>\n```\n\nRemember to add the URL of the silent authentication callback page to the \"Allowed Callback URLs\" list of your Auth0 client.\n\n- **client.login(options, callback)**: Authenticates a user with username and password in a realm using `/oauth/token`. This will not initialize a SSO session at Auth0, hence can not be used along with silent authentication.\n\n```js\nauth0.client.login({\n  realm: 'Username-Password-Authentication', //connection name or HRD domain\n  username: 'info@auth0.com',\n  password: 'areallystrongpassword',\n  audience: 'https://mystore.com/api/v2',\n  scope: 'read:order write:order',\n  }, function(err, authResult) {\n    // Auth tokens in the result or an error\n});\n```\n\nThe contents of `authResult` are identical to those returned by `parseHash()`.\n\n## auth0.Authentication\n\nProvides an API client for the Auth0 Authentication API.\n\n### Initialize\n\n```js\nvar auth0 = new auth0.Authentication({\n  domain: \"{YOUR_AUTH0_DOMAIN}\",\n  clientID: \"{YOUR_AUTH0_CLIENT_ID}\"\n});\n```\n\n### API\n\n- **buildAuthorizeUrl(options)**: Builds and returns the `/authorize` url in order to initialize a new authN/authZ transaction. https://auth0.com/docs/api/authentication#database-ad-ldap-passive-\n- **buildLogoutUrl(options)**: Builds and returns the Logout url in order to initialize a new authN/authZ transaction. https://auth0.com/docs/api/authentication#logout\n- **loginWithDefaultDirectory(options, cb)**: Makes a call to the `oauth/token` endpoint with `password` grant type. https://auth0.com/docs/api-auth/grant/password\n- **login(options, cb)**: Makes a call to the `oauth/token` endpoint with `http://auth0.com/oauth/grant-type/password-realm` grant type.\n- **oauthToken(options, cb)**: Makes a call to the `oauth/token` endpoint.\n- **userInfo(token, cb)**: Makes a call to the `/userinfo` endpoint and returns the user profile.\n\n## auth0.Management\n\nProvides an API Client for the Auth0 Management API (only methods meant to be used from the client with the user token).\n\n### Initialize\n\n```js\nvar auth0 = new auth0.Management({\n  domain: \"{YOUR_AUTH0_DOMAIN}\",\n  token: \"{YOUR_AUTH0_API_TOKEN}\"\n});\n```\n\n### API\n\n- **getUser(userId, cb)**: Returns the user profile. https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id\n- **patchUserMetadata(userId, userMetadata, cb)**: Updates the user metdata. It will patch the user metdata with the attributes sent. https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id\n- **linkUser(userId, secondaryUserToken, cb)**: Link two users. https://auth0.com/docs/api/management/v2#!/Users/post_identities\n\n## Documentation\n\nFor a complete reference and examples please check our [docs](https://auth0.com/docs/libraries/auth0js) and our [Migration Guide](https://auth0.com/docs/libraries/auth0js/v8/migration-guide) if you need help to migrate from v7\n\n## Develop\n\nRun `npm start` and point your browser to `https://localhost:3000/example` to run the example page.\n\nRun `npm run test` to run the test suite.\n\nRun `npm run test:watch` to run the test suite while you work.\n\nRun `npm run test:coverage` to run the test suite with coverage report.\n\nRun `npm run lint` to run the linter and check code styles.\n\n## Issue Reporting\n\nIf you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues.\n\nFor auth0 related questions/support please use the [Support Center](https://support.auth0.com).\n\n## Author\n\n[Auth0](auth0.com)\n\n## License\n\nThis project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.\n\n<!-- Vaaaaarrrrsss -->\n\n[npm-image]: https://img.shields.io/npm/v/auth0-js.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/auth0-js\n[circleci-image]: http://img.shields.io/circleci/project/github/auth0/auth0.js.svg?branch=master&style=flat-square\n[circleci-url]: https://circleci.com/gh/auth0/auth0.js\n[codecov-image]: https://img.shields.io/codecov/c/github/auth0/auth0.js/v8.svg?style=flat-square\n[codecov-url]: https://codecov.io/github/auth0/auth0.js?branch=v8\n[license-image]: http://img.shields.io/npm/l/auth0-js.svg?style=flat-square\n[license-url]: #license\n[downloads-image]: http://img.shields.io/npm/dm/auth0-js.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/auth0-js\n","readmeFilename":"README.md"}