{"_id":"@azure/mixedreality-authentication","_rev":"29-e6e26e1cd6cad859f132bf0649af2939","name":"@azure/mixedreality-authentication","dist-tags":{"latest":"1.0.0-alpha.20210216.1","dev":"1.0.0-alpha.20210706.1"},"versions":{"1.0.0-alpha.20210216.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210216.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210216.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"8aafffd5006a13a0cab1768cf4a2e9e878e8e6ef","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210216.1.tgz","fileCount":43,"integrity":"sha512-Ne4aLS/G23yK2/E+rR/Yy29WzgCjgwVPMh8vUTobJz/i9qAdBBkeWNai9X1XqQeJ/TaKOvD4GTIXgUMejzhZlg==","signatures":[{"sig":"MEUCIHbX6RwTKDLhh8ZDicJbN5oiZYTveCHG5DyYvNibZxQLAiEAxaw2yy0QP4QTQaCM/HZ983eQumEX9uQOjrn+AF29MwE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124711,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLHOHCRA9TVsSAnZWagAAIpUP/R+xKgU51uR/QwQNk+hI\n7ASyfkzvBGHE30ikn/tirEmB562HtX6qtZse5lF/aCLfg+nd1zEc9Dyelkgo\n2A0XApYF0X3JNF6ytqUVLiAUSigvYJERJfxMBntmTDIxS5i29+LtpeiUJO0z\n3GBo3zAz4LXhXXgl1JQ5K+kMC/rimRPSojT98EGkkkVM5APKtwfNgkAzEog+\nHdXwAcrbTrVtYxvp89mONCcO+Zdsk++0qkADIN0Q8Zy0o+qPzUM7xQu9P0Cp\nzDw9p7+PSq8W2jWVQvHvIcuE77NGBSHXFfUGWjOd/POgLJhbOv0wLeJp9eLa\n9E0BJkgkqakI/vNzZwqatbHoYQN8VemCSXGFEUguMDQQIXtCq/or5MIphefZ\n8QofwdE6fTVdpYBndmZsFU/s1YOy6vQfaYxuhhHQ6GpdKxMQ/jEc+AkzChRx\npdQ9RahRaItyFYMwD8Vn3wyf2tLvz7jy/9NWsD2KSI8mKk3nypAZqKG0OjT1\nHDjMd2Vx5ym6x8+LcVC9So8dcTjnZtatohRTnjmy+d8JYFoc5tugnp9l7Tb2\nAEoP5+pc0IvrSCxHJiFJuY1XmzH4uauHLLYo69JEqFkC2QbCSPhwCesBL15X\nnwV4qtw8CmYC7laaXBW4LCEyzVKSbP0zNzehimNtVrfIsqyB/VNT4t7osAyn\n+1wd\r\n=f7Q8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210216.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* test-dist temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.10","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^5.1.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210216.1_1613525894902_0.5483716166399555","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skipFolder":true}},"1.0.0-alpha.20210219.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210219.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210219.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"c48cb29c1e157d5837402d4cf9e759877c4abcea","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210219.1.tgz","fileCount":43,"integrity":"sha512-20M1dJdPMOmyaqUq7uYjsFRC+pND0txFlj66vHoot8RVDcOuQqOHwp97wZl+R5yUxARJsSJWAvJeO1oZRSJFmg==","signatures":[{"sig":"MEUCIB4xyWu1C0wvI2Fng4rUwcT2QYNPv4dD1ITPT6UMIFqcAiEAuIOFjJ9K07kjgYHyym8kEbTzkVJAM0FYTzy+3uAn85w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMGhaCRA9TVsSAnZWagAAqGkP/RrDRDCTxZXKFsQ9U/gx\nIiMoGwFjQevgk9L1J2EUNv1bK2ivyblnuPXJ8DS0e5oG5Bdg/9LcOlL3cm/j\nj4fKohMT4KdUc2r0cRAe83mhri3WS5ygZpATGjE915RBANxggufpyyygqbiF\nr/tx6Dxgh24UPmpLhY1yQYIr7/dIVpeoPFDbqkXjSFp9tJHCP+UTnpreDv2N\nPZ2LmYIIuZ8iCIEAut2kwq4egh5NNLmDE9xx0UrGNrf16KtPXOIv0e4hVMMB\nABAjrOS+w95SRKbWJWgl9oIRw7tTNjbzezPGv0Qq4aaMvXFbuZrPTSzCEB3v\nxQBiGTO3Zl+mcmm+M9cVZboizELq0mB9ydf3cY3W0xBvVjRyKGSMoZqmEtMp\nmIE1qDsSOT8fzq2v2xKfkUMBzBQPD5ZQBItO18am5cO4QnDtV8t26pMMrVYD\npofsJJGMR6CJDWv9DGaif8qfAkGOzDoQi7qRn5dqToQqr7T141U7XENuSBoz\nwrrupTHPHj/gnRQhuBMAY2hhlbCPO8TCZRTAjacYzKXYX9jveAw3Yx/o4moi\nHKVClohuiCGFa7/ynrY6y2BEaVIRrSjkXwF/3cgYt2+AjjkOvvE1OpBTGjo/\nH2NR8LivUSc7PwtX84IX1ev0X8sodn1q1XNoNWBLh8vZq59EcmQDs1L4S27k\nH1Yv\r\n=X7ew\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210219.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Enable logs\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and\nresponses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at\nruntime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* test-dist temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.11","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.5","dependencies":{"tslib":"^2.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^5.1.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210219.1_1613785178287_0.3559348002922045","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skipFolder":true}},"1.0.0-alpha.20210226.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210226.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210226.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"ec8c5b88bd59823714afcd87820bbb4b16970e95","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210226.1.tgz","fileCount":43,"integrity":"sha512-kGyk7DufEhzEawAaGLpcJX6dYqNGfEkPHUX62V+RgvWbTJ8vImOSFO3/GgSGUzqrGYBeJxhJ5I9SSkWKKnwt/w==","signatures":[{"sig":"MEQCICMk60ltRWNKe85IUp8JRSJ5oeyydqIQz5380xuGCx3LAiBNSatPxMGmEpBtf/2ssvhu5gr5x54dLD3NTmiKWoyQAw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOaMFCRA9TVsSAnZWagAAOl0P+gKxqz3Ldi4W5a3QnGLI\n1MK8HEVFA2FZVc1oaidZO27iIfpGWuNUTYea3J3JNWb7yYzd9ozJGAHNOhmy\nE0AA6R+S2vOhvxwH6PXvzHjCC54pf5589lY8FSRrDc9xq5tDWRL+NsMMTcI/\nNx2epACkmwdW5TKPZdyqdIyyXnbMeph/s/rLvNxU1nc3BryYwV7KlIYTduSy\n8ucYKNVZQHWATh9gvvWkbMmcj+cNn69iLYa0dcSBzTsm5PG4tT61aVRUnqCp\n9JIalsCR4zKxdjvVdcRK6rLowRaw2LsXCS0rrV74MpYK8qhsdjZV7kue04rV\n5hJyucz2FRda6lq3s07OeO1V1KCxnET499laaEEK84qqBItxjE5WrsRm4TZl\n+FY1t6/PLWP1d0DIdGyLHi/PsX2JlxOrod1XdSJulqcApbUc/LF7S37DXSZD\nd5mrq5B3DwVIGbR9klCycx5GrTfRI5BQVVPJXv2fwjCiuveroq+h0Nfg66bM\nYnefu2w2zpw0PctnCAA3gzZ0URs26MKyp7B6qxn0VZ6vZ7ymtAkmI47G5znH\npLDybYP0j6x1jOQAySWQN0WhPjvqLWY+uY5Byg8mnJfQWvWOJb4BNxSN/jcl\n28l6B4z8VsZ6Y5vksQy156W5G3Zmyjj74GZC6NMxmAwCoYF12CwJXS3qj6TE\nVapb\r\n=6I14\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210226.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Enable logs\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and\nresponses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at\nruntime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* test-dist temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.11","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.5","dependencies":{"tslib":"^2.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^5.1.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210226.1_1614390020706_0.37149463230026325","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skipFolder":true}},"1.0.0-alpha.20210301.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210301.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210301.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"542d8d2d18b7a8d389c12a7448ef5d39eb75d2f4","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210301.1.tgz","fileCount":43,"integrity":"sha512-4uzNm8oMEWIkOiIgQX4X9iJpenCWZISo4cftcc/qcriMdXgiYucRSM0ft1FR6wrvt+WWiKEduopqoJLFJD6O4Q==","signatures":[{"sig":"MEUCIQCvKX8uqwRaQCGfb8lmu5+fPby0TYdVuV9fB9acnKmoPwIgDVJuyGFGWLTxamqmhd91PuFpv/DMs8CPOm7eEQcSf3o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118633,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPZc4CRA9TVsSAnZWagAAofEP/2nQ7LiqEjCgHbuaEGkA\nRu27V0GHIqGVomNFXYw5gYlvKEsXbrbMOiAn9Hs9ob6fumWdXxpufQraq06h\n/R+u0BL5POw065qTHOtFfwcAMESk4Woq6vpsTXpQAmbCKt3SLMozrzR38MCu\nNwELJAYC6Z6mGIEmaQPoMkvW5QInmq/pbmiFnhcKL4/6F5ruBFpkFREmSdSw\nhYpyhq17UnXKniROc9qxwpFEjxfTgIS3lQYhuCRSoWSdaP5ykSdn7HVAKRYq\nEaE3nyB90sFxBSKmac4G894X7xfDRxn9Nq86KB3LfCduE+Tdk1+cUIbZNfET\n0Eensvjlw9scfgIICs/f0lUa3vmbsnr9QCzdum3nhms/I4foOflnxXdV9IzR\n3WhFMt+PyOw6ZdIQLok0gxYdKTBwyNEtGjM4sl2SE2ecpAss8ToIGS4cE1zQ\n32ykx3fmXvOm0HRiv2kLYem2d3nFOwWBx7mqdk0Xrf2tHHCAOoFMgubxp7II\nPUPN8Dkmy+jUTlrL41i9EhO9iMnE+bjP7u5FqHZrfgTKVyqGsrVmj6TTlfT2\nsbnqlw5XcYHF7TeOmQBf4Bg3l5+HPZ+ybHvXBRqwVaiJTJk92kQMppljiVZU\nFP7wwFGAoDnGopc9psIwHcb0ahrriVP+IldBlN8ffLKKFW2kok/luXT+haZO\nYVbj\r\n=+XsS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210301.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* test-dist temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.11","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.5","dependencies":{"tslib":"^2.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^5.1.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210301.1_1614649143587_0.8386667353032107","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skipFolder":true}},"1.0.0-alpha.20210304.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210304.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210304.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"6cec6c20fba9004b49c30b804c91c83eba43ce9e","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210304.1.tgz","fileCount":43,"integrity":"sha512-AFkcl4Tyf9gJ9cDOvf0MnluGfLJYDokK5VHmA3lYk0yBCIuhdvmGRAVMrEPfMyLLsVqmK+qpfqwXgmvj8NwvPg==","signatures":[{"sig":"MEUCIF47Ah8aNIZRsj1onQJqiY2ZEreN0M85aC71PeE8ahn2AiEA9aZ4becqPlski7wCSHDtBSpDaI3sjacwqoARYiMQ/Eg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQY0FCRA9TVsSAnZWagAAIucP+gKFi124DRtcE8HYagM8\nD3KctmKnlnvTpDW8vjxmu2B9GZ1W4qTV2a4eWUJo2sFlmRdJ5zLj8/G5tFxG\nNvzu7XvEPA7zn5hrg9SFqB3GCbnGxek/V242kwJbCP9X8fkOUCN/QMrm9H71\nupYrKq6uHaiPysIeg2/ZZaZ7tWM7PCOd4VaQFJ67W1jsv+k1AtIoAwk+HESu\npIOByOGAYG7dEint8cufEUHwhCx5L8ImMObKjKB8eGZRRvbId79jHWGXpbXy\nSg42VYyYJAvgU6JIIPHZphWIKrqBobf2PXkiv3g2T9saI5ikpAdODVo9Mn3K\n6sHmXEJM8XLJh9YtztYjV4rZibqyRPU2N/L2+5XDVHmIsHsQtm1j3OuPNAcm\nrmQqcX6SzBGO3G8SypqWZtkLr1LiChh78FtrJtrGddHA7HOIj8sJt09YIEYZ\nGbEh8lAJo1ZPqakOLfKUwNvWOr5ISiuYah8oTDrwnk/ntAi4gV48aM9gyRTG\nOQXSYhnR3ogTacsOX4ta1pGGEI96c5TXK535q/JJ9bAsJq0bN0lcLPkhqEM+\n2HfVGRUgEJqFvCciBmPsi4a6I+BDZfWcVZdN6o8txfIb3RJKTBOleswQ3zgi\n6fcr55zhMtZfB6CNoIWUVnvwZagiovOgbByeUwmGW1bcaLPIx+8+USx7UoLj\nYj26\r\n=a8Oh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210304.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* test-dist temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.11","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"dev"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^5.1.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210304.1_1614908677407_0.4312810190293037","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skipFolder":true}},"1.0.0-alpha.20210305.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210305.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210305.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"1261306940e240f1dbb0293e687bfd4fc2c4eaa7","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210305.1.tgz","fileCount":43,"integrity":"sha512-NGqnPm4/y845ui3b4H9AXt7GDBjUKZonQSDkWr4zPg8L4x8BvlUJp3mvQHOSTlvP7cn8Ln8Y7DOQVvh9gVOy1w==","signatures":[{"sig":"MEQCIB5f86EMdOKMERQaG4Yc7vXJnE2VAmfkHIc6gUlEXyoAAiABZ7TrML2Bm9xjpnjAZSh9JLpUEt0w5tJwCry8dTfOOg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQt4wCRA9TVsSAnZWagAAv08P/11z671wGoRFd5ve+EFC\nMSiAh1LtgwHjf7Kp5PfYNzm/n3BV2rFlvKowlJU9w08NAEZgGXGAedPwmGc0\nU7p1Xai/cWjLHryJrK/AgnqH4dlwARD9/c3GlSSFGtZPMPjGEg8KeM2QUkBc\nesAMyFFyqnoq++Kj8A/IAlFD94oOQAWm1dJxDjcEx24YSW+Lw0ZQOy7zM14o\nwDrCJCKjox8YYN7qntERCLxbvo7u/WEuKme/V5mESJsoCG5u9un9HZVQlVsh\nRE2YhkcgJpQHCuxHmekpmSjulXgvP7qn2G+FUG4kDLWUXik47uO+UUHQvJd+\nSUIlsPVXL64bjVlWQdE7SveXj4NLB7yHN6d76Foou/sVR1Ad6v1/HTJ4hkAi\nzWSZuw7rcvZvtC3vX5QFNHHy9ETpWOZJfoVYrLHva1enHisi4swFqCb7yAfd\nDP3hJFPv2mG0U3CK80SeouFMCbtTjWVW/DS1OgiqbVmVtNQWl7PlvHsMeFYD\nwBg8JcZdivQICydh39ELmVoQVoDuUWYCXJQuipqJg2kK/lKuipfMPiG4lnvw\nO+jDwv1LHFyXCPHlUmpA70H+8h6he3xA3K7BX0NKpy3zkEgNkREkmeZInsXW\nVBqX5cuSErCcXwIGRpXHMwUsNqlrmnTAbVEYE1jLHpYkMEcKiyNwoOPcf0XB\nBJmI\r\n=waVK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210305.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* test-dist temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.11","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"dev"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^5.1.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0"},"//sampleConfiguration":{"skipFolder":true},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210305.1_1614994991798_0.025257172610337664","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210311.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210311.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210311.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"ed2d1242b1717daa0b7b2aa3ffd18359c9694199","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210311.1.tgz","fileCount":43,"integrity":"sha512-+GyP3ICJ5fukmFvOLmYZdaWcQPbfmYiTx1YfZWcFtvrmFRbvJmKMdQ/67Yx8ysXwiMdwYxPO09PctK8I7zDvtw==","signatures":[{"sig":"MEYCIQCihMgBi21RxSwDrjQpmdDjY3YyOUW0tzZgIK5ggpHdbgIhAPPsjjH/Jj/FgKa/8n64o3uinmgkAFO7rHGjcj6pTnjo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSsdUCRA9TVsSAnZWagAAF4sP/i2+rRoS3HfyrfS/PJpy\nzf1J2OqOcZgah40R/NeD+UTlD9nxlsu+fqUd3Tb3inHlaHKuo7GVyurS7fGp\nRxNT3r6HRaitm7+4ktSNPFO8+iDmJVkGI25Eecw5To0tq0U7H8ZMgyY0E9Xu\n/zeE0FDHlxjYd7Dd3FXHVCIRh87Kta/JlhZ2LUvE2+azJ4iWBfZglO150etE\nDkWdp5UCy9RxR0i9unPMwtwkmC101JJTIxL5abT9LQrSJ9Ke91LFYrJSj6zK\nMcC1qf42gnXrDaPHQBU8+PquQHys7G/CRds5IwO1n72dhPmBtZIHrHxNO7dK\nRRW2H2t++s0PggB/zJW1IkOWF4C8Zh+LVjJuVZOf0J/KTXha5o7OZ1kSSUrt\nzwx6FHt8o3zwbEoc/vzd+oOksRMSfR1q3XZuTA44ZKX7HFzUTl05j/PwrfPT\nkq3+79bKLXD89jqmyBRfOkljDUOBm2CpBv34FCzkGZcuOSvoR1qfQ7qsXTvC\nQkpoPv7h7jBiW426VrUKpbkPwjYj+SQDDpdY/1UTUOPli0Rvzt8u24PimSUn\nqbMb+VTVY9zCbGI2MKJ1DbiLp5gPyrbzNhHmMHNiqmoP643cDVq1H31wsYIB\nYZaj+9xIfZeSIpCG14toHh1gHnaxjg4aTPlPVebiVl7hmZFfXX3QwplzuLrP\npocm\r\n=Azp7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210311.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* test-dist temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.11","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"dev"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0"},"//sampleConfiguration":{"skipFolder":true},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210311.1_1615513427520_0.9688505314797946","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210317.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210317.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210317.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"f9f10b8dcf8070c088b586a196dc1ea3554d4640","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210317.1.tgz","fileCount":43,"integrity":"sha512-4r94d1yYtUFFG70AY9c+2TUkqX45gikLe+rcKvBE6JbRyIDW1iSc2paiASfm3l+4BU02SnQ7DUo3VgYJ1XJ0kw==","signatures":[{"sig":"MEQCIGFY1waMDjNTvwgWLDEvaMU94ypEh/opc7M/FIQ1Wjd6AiBkQ2myyX8q6/FewaHjzyN3xvJXbteih+8lCpiNsTfPdQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118630,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUqIUCRA9TVsSAnZWagAAPCwP/1Ab7oNabkY8F25xdvE4\nzDj/mviPDs15dQ8+r+DAIttwLgZ86fMwtqJgyxynsAPB9lu7rH0lp/aOxWJy\nU44TbnyJDBepM6i+YyjvDsx4NE4WhZSVpE5FxlyGVEsn0XWOtffiu0jkoiAh\n02VoARjiVvCdgQatZPe+TKIXsz0cZ2JGzt8bD5EzA7sqR9o8QPNLP44/atsV\n9oPJYirpxppabEQ04424yyfqxv5lWi8cG8cB31Ve1p7txs/FT/eA2UzKPKGD\npyVchbuiKF3TqPXUflj7wlKZb+ts9d8jmiR8R5P/EsURcf7Dt3J8Ngqp/eaE\n3iyETTLqdR3sWpVOcnapuBjKRmcwfOp11ebDqXKeXv3mZIfnUsmdVeg5WUGX\nzvVPCbhN8QDH+XcBlzKHzK6zmYFUgZboIXyPaBRrVEx/vCoO6QiIsRaFGNta\ntEB9O4ThYtvaUyDQvwk6BSelUw8CXSwwGh/6uX4DUW9LvIQeRGCpnBp0g45H\n4eo9TfRw9WKIX0tzx3A5u/6MZUfDqc1/FfIo7Knmtoi05iYnZExjiWcputVJ\nldUe1EaY8sUnsWcUxwjl3qWXQI0bpkiKzNz/gkUacPSixCiUg/QjZHkTDtHu\nVHQGzPikLbWxQXlR9N8ct+PCCbOgk/mGd/LnKZ5ATmZZmr/Rz+UvrN0mt5TB\n94+C\r\n=jK0G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210317.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* test-dist temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.11","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skipFolder":true},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210317.1_1616028180456_0.6447430614678915","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210322.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210322.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210322.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"6dcf81550e5e19d4b97360c35d1f692db49b50d0","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210322.1.tgz","fileCount":43,"integrity":"sha512-NC6frrKSQaHwHtRI2BSea6vJ7xUwLSF0W1wodRIp+SESfcuZpqWXShN6Xiardz6d/N2JibKSgAAekfbA2k4WWw==","signatures":[{"sig":"MEYCIQCPXv3+bA9qA556hZGbq1v83FUBEYDogkJTLx2529i5egIhAMXCUHKbAygWGKGcBcd+5bOME5nmHWCLvB1ZIxAmHDWy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118631,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWTmzCRA9TVsSAnZWagAA1ngP/R8P1f8N5sV/VXF4d8TA\nI6Swgj58gE/txq5ciDzsSXkb+cpe3u8yrHmX9KCJzDLSEAuQFcfOmXJ493UC\nMfDReIBNlBbaApRMrBgZSv0Gm1Y8zUOMr9kUfg23m01FWYxlG8xpvBklZT+X\nriZtfSnQzk82xMI8nP3Z3KUG/KMDQUA1PcX5SDNbxYgRXuz/OHvne7HqY6HC\norN1BlJW5i2bFAdn116fQ2kMXBUtMOVBf3Go3S2939cBcRWcwaAbL0tlqY1A\nACwxCkPXinbYxMG36wgvHee7XluS99PfYZwy+9BCD6ldeLHvaivV0tnCmP3Z\nKn4VTv5WX6/oILbw3Ta5fnMlflCillOLRDMuL+XIls9IN69MzDtBBagiZeqq\n41+Qzc2qKYRop3kxl49c1qeOPjbjNwoyDwoLQi+0jfB1nF8YqDnpMx19U+y+\nLmw3aZCDTvKEV/kRsSITOvUa9T4XSYM98g833I3KtqTV31t7NxbYB8ty4Zxq\n3RT+2v9yIp/ijP/luNtiYASmVYyhviC/wApqLkamFmwHy+UjXBBCYvn9me5p\nILsMnM0Gw2fycSXLq6rlYc34+CVeOcJedAKeo0DLUJoTGoU9wSWWdDW2P+hz\n3NHmnCE04qrhyRxNguZ+jE3lthr+eRTHaS7nwwF3dG8ohhcLFuT5m6xTCjVf\nMv7B\r\n=t/Hu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210322.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* test-dist temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.11","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skipFolder":true},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210322.1_1616460210619_0.1331486039688301","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210329.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210329.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210329.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"e85e4e07453ca5d907be3d9b340c9a13388b63e2","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210329.1.tgz","fileCount":43,"integrity":"sha512-aGwX158c3+XeoTBBkSy5eKEFGYJrfFhIkZj2nhxLQO0aGpgSvJTqjnmczuy0aZCdBXmoQ/QsNwcyu+LHRK46Jw==","signatures":[{"sig":"MEUCIDd2a3HlvPfaIqrsLb5KjqwmCgrKuQ6sM7xX3Le9cziCAiEA7loviT6rIo1aw01yC2JgnH1EtjRAmZtWmjKPYkXCaG8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYnOLCRA9TVsSAnZWagAAwdkP/2ymjKgsLfug+4IQ/CgT\nzLDk6h55rwbL/Pp0U5ZSnz7NaSOkxBaG/7hk5K/RDIM89CjtVZh9LHwViwzx\nitTHtWC4xvLkk/mm5ixrFG7tKuPCvTpqIXaRRXuB4BUdgdVztx8pm2dTvK1/\n62cDZxGxiRvuClSIk5BkWNTDa2ywD0x5BuIVRmx46LdRO9IKUSPQiY6EGild\ncv1FkIe5fZegPmsA90L+Q55XfYOg7X7YR2zsiV6DDXVaGS/ahbD19SeuoC35\n5mBx+DT8NT7+qfju4PQYWuzK7XtzKlLZFhZKRSCMSOkdQDN0B7BGVIHW4iz6\nLaioeT93SveuqP/x88sUjzkUWe3Tb4p/hbVnA8AbBZS+LGrPjpkqLcPRZ2od\nhRz1ASPbcFNmQakQ8Aq/b/Z8MYX5+Ep79VzwDMZRuXQes49I2xthJqGi+GxD\nq6t7ActAGgNs2iVIFDT0RLO+nRKl8pysxAlQ3976nFzjwwVO4Cz8Rr0mlf8l\nWFgceAoDaJuu0qJW4rZsxz8CFz+5p7MyqRhKCqK40EkL0Bja9YCDcqboY/B/\nXPFrq+24YuU3y3wzRhgFG7+1qH6/WFzkb0tHyzWRtHpXg6QnE3XaJFxQycBa\nFHFmJEoIRrEAK2F/9ETT3TXWWCa7YUIK7TXZywuCv7WhNKg7T6vEtRRT8o9N\nHmC+\r\n=zXF4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210329.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* test-dist temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.11","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.3.0-alpha","@azure/core-http":"^1.2.0","@azure/core-tracing":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skipFolder":true},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210329.1_1617064843104_0.5477173055493416","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210331.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210331.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210331.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"9e7490c18b3d256ba99b21ae625b799f4b092615","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210331.1.tgz","fileCount":43,"integrity":"sha512-uwN3H4V/4kkmhtOByGV4bPD5rIOvm/LbRYfRwFoGpcu9U+hAb0lEVvAut6Pp7JFNbPJZesN97A+xHAVDABWsow==","signatures":[{"sig":"MEQCICcyY3jct52i8G2fBCH2pbxlVf6NBGgyvoAPKbTHpp/PAiAZfXr3EoqgKFUe5OHx/XfSoXHfd4CMSTbMFfLlQJivsg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZReuCRA9TVsSAnZWagAAy4oP/iRimNZW0HZcuKO6iqLf\nvtPrUrstP6SDbuW+M6RqX6o+WETRx+s8zygvlfWRGTB6G8z+U7RGAHIX5qWg\nnFARsKvQyJFhIimzvIHL42ZNKvQoqFGfzCedjkIuQEQ6IsuClFr+So8JVbDF\nMXig+E+B6JSoUEZzOmcodBxxCryMrM99tJbaIXt0w6tAhYJJ2mJ1MGnk/Zfq\ntDr71MXzW1S3W973EgOlIgNcPstRESFMFThgddBpaSnoiDq4KGvcBlM8vBRt\nhp+cwR1aUsC0Hh+LhnycNX9qeLI0Mw4cJY0Z5R6mk2b0o5U8UqGXPudOOw0t\nRo7gCwv3I5xd4gvSMGyB9U0mWIq1PRl0vUW0flAXlxWn7LV7BWe2oIoFO+X4\nZnbMW7aV4nnoks6l3e12IzcnTX51PJTmP5EV3TSxvw8VQEa9gnotVaRn48nD\nM/eM+uOAiIhyP1f7wJr4Ag6aBGScxGtvfzA329NeUMQUPYMNzTbWIKOGLCkJ\nD1bckiUkWlVsLW1c/YFC7iH+7c29kcSPmIjbvajB97BaaieVX9uVG2gjnR67\nM7dK4HsiyKeBQ/7S+MdCebrVC4OzwFKxsPi87mf8ERX9wDbGL9byTefhpubR\nuZQUvJe2z8J29drsF+8Sc50r5W4V2kaX5Yisefze/Wp1MoEYHThVS83ZVAES\nL5UT\r\n=xjEX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210331.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* test-dist temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.11","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.3.0","@azure/core-http":"^1.2.0","@azure/core-tracing":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skipFolder":true},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210331.1_1617237934476_0.12971876559689766","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210407.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210407.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210407.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"8edbe58038f12af8ade15255da7bcf5dce235549","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210407.1.tgz","fileCount":43,"integrity":"sha512-JT/8vY1mSz3E3eObCcCQCH9gYRuSzTu22rW2wMATksGMz6xjHwEHaBvLdaxkx/Y8ru5AmnWlDlpUBel+7F5l5w==","signatures":[{"sig":"MEUCIQC0yUlc/KDiUk92xmR2hYZ/aLYVJEX0kqZzMtPqOwO3UAIgDZw60OQm7RxrUspNjI77hLxNAXI7GcH4JopknV905+o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118553,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgblNqCRA9TVsSAnZWagAAJLoP/jPb6AYG929xUlMBfcVw\niOBFzjuvMtjgpvO0X25xcnpflYO+vTNrQGvlOBh2HVzLYJXBLXrYqnlb4u6s\nwmYbxWy/bYkng03mbOvXnTJT9QFk3zuG0dHksw00sXWY2yf7n6l+Y6JOix8c\nrHWHFSeQh1r0kygEtJlqQG+sE0FJ5/tiMd0PU/gI+S9HdGjHeluj6ZjX0bpM\nZs7Qny15dxUNJVDffHwL82vZRrZZhiQvdD0H7P3hdQbJfaaMoxT7Wy41vkYt\nTMbx8xcl+4jSxzxnyx6PLDk7KYuS8BNYXf6igKw6uD1fBAiRt5Ixwa5NiZVf\nrZyPjhtkTE92pz9C+MAPi4bMzgdsbz3B+imnx3nsALlEXxxTL7LWiYnSfCkA\n6XQZCCr7dbhBHESOGWhNrYaLJt4zAJ1Ih9zDnFr2JXgEeWZkm5JR8TpK/Ff0\nUSPQ8iA6Aa2wyICssAWViMbcRcc5PAJTr59ckbb37h0Q7jWiMG6l6TPDhyD6\n1igM0UdnMYzfKMlkYVO1ju42gc70iaL+J9CkYyH2EIJtfhBlWmR+tSDJbd8S\nzFW2/Sz0Szm7Ogs7jNpQJQ1SwhvsHpslxNLhBSgTPSo2N/8U8+XENNah7nWf\n/iBQcooaOj3Bq1PjncQW7Di7qTxUzKroRvkOn4AiM8GssmO/hjLmsmIGtqW9\n5F+6\r\n=7j0w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210407.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.11","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.3.0","@azure/core-http":"^1.2.0","@azure/core-tracing":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skipFolder":true},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210407.1_1617843050395_0.978060590229153","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210430.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210430.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210430.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"9fce872fa302071177dce0ddb27fbde2c806a128","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210430.1.tgz","fileCount":43,"integrity":"sha512-QMr6ECxUdDDjlr7alWteTel5vPmuY5usfk8Q2a043dsrn6j9DUyHCNGZqOdkl0jx1T3t7NdryjxZjppCW2qN6g==","signatures":[{"sig":"MEQCIGWDyIck0hfEuTKdhFpEPVLUTQKxEG7rK0E0CgWccQ9gAiAj1TLTNS0Tzd/yZB+YQF1Yl37IyrB3SskuoHEXy6pa3A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjKQECRA9TVsSAnZWagAA88cQAJ1fN43ae+m3dHxCO725\nx2SS/4ajX7Bg9vIZa0yRNdIFQTT0Z3wTt0+odvfNQzg5HkZ6ynGJcHduZhEo\nIOK9sIMaaTMKrlDgn39WFXAhzvv5S+2WZEFQHv3pGYR/r9RgA1Lvn0Xj/t7M\nxiE9Npf2cL6wCX18TKm9jFRdXMoRNvZT0WeMD3AU2+cKotzmemU4pO9Ej4Y+\nteLKfQH93oX7l9+jCuD/VOmsJdYyQuDIxnUcKH3uOFtU6HDMjC4aPWaRIpmS\nTvlKSRuutb7l7f0WA24ZqP7HZ9rVIFeKatw3MSlmpSVRhRRDMnJ4BItBBAHY\nvWEk/nB+82gKwkeVZATj3Nef8hpxHt5mjJXFdTzd3Ll5clWlUmKOboHclfj8\nXDFFkCzH0DVJz41Y0m4ZL+h7R2kH1Fk6D5/4hxr4UbtWXEZ7BPNabn/4+T1v\nGj6uCi5BXqlKwmybZqdBxhY3CNgvqGOMl3ciiwMoSRajm3JF5Wu5nXY0tumx\n5aGoZjqdRu+FcNPS4s55pWvKPKrHNKcdzeSPhyVdu/BoDdh1sTZTABd+TcQP\nnEjuJsCBbSDhZAK+1pmAQEmUSaLz1IAKNrOAetbqhC85iiXEPNebU6vrsjrW\nUmJka7MM+toqvqUOASDOzvLpnAeczwdCDkUhAGvgT5fPRuryve5eEEqT5zhE\ni6r4\r\n=eTNd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210430.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"echo Obsolete.","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"dev-tool samples run samples-dev","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.12","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.1","dependencies":{"tslib":"^2.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.3.0","@azure/core-http":"^1.2.0","@azure/core-tracing":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"apiRefLink":"https://docs.microsoft.com/javascript/api/","skipFolder":true,"productName":"Azure Mixed Reality Authentication","productSlugs":["azure","azure-remote-rendering","azure-spatial-anchors"],"disableDocsMs":false,"customSnippets":{"prerequisites":"snippets/prerequisites.md"},"requiredResources":{"Azure Object Anchors account":"https://docs.microsoft.com/azure/object-anchors/quickstarts/get-started-model-conversion#create-an-object-anchors-account","Azure Spatial Anchors account":"https://docs.microsoft.com/azure/spatial-anchors/quickstarts/get-started-hololens?tabs=azure-portal#create-a-spatial-anchors-resource","Azure Remote Rendering account":"https://docs.microsoft.com/azure/remote-rendering/quickstarts/convert-model#azure-setup"}},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210430.1_1619829763470_0.829575620263703","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210514.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210514.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210514.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"341b35c277042a13aeb4373eef8cf4cd7f1e2b6a","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210514.1.tgz","fileCount":43,"integrity":"sha512-KLT9NQB/WtxwbSaQylFMF9UZNjkaqcgomQgjJcuvVjNUrYkRXP1mOE5ozMDG5VgGFpWxyGQX8CoDWMzZ0lUMIw==","signatures":[{"sig":"MEUCIHeXkpgZLws93XkphxW+PPPUW6nxnsSRCdV1aZs77NrKAiEAz2FrnLc0NPqT/dlsBIVfJh4TdlhHtUjmlfbWwz0zf9Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnxkyCRA9TVsSAnZWagAAT5cP/R96qAfDQH19QQrSTw9x\n6nfeZWm55ys0DKJtsN5AMy+v5KTLAIYUQTJRV8c3hgf60gPppA/t9n/Egv+u\nK0UkpUcKi+VjKrLqYtvxxChzX6n+5kiL4XzexYs8c207aFT65lj5yP82WEUo\nulW+B+Txs9xN5kxL5COaXB9YO1Yz7frR7CIl7TyCb0p4Hls1wlmN71OgLsXu\njanKrjUING6yywt2spuwz1FkBWOdOrr+LjSxpNgiWfq2ZPBKWJQLlvJ9fBe3\nWs4vQXRhfmxCGmoXgl2uPWRqAAwe9DrQG9OcjG8lWtoKEcKMQ1XTsXF/4eCB\nIWZsc8X7LAwqca4sLfERCjKgxXVQpXxYq2kgFWV8MpWnaYQYCsX0hggfTBjr\nG/Yg7tOO9uYdgdIhR7UaAXvdKIqfYPYDqFRNFGPvVRk2NlEJ+8wdUtt9oeAH\n1pmnboD25FUvwyspiz1KXr7bNeJ8VBQIbrlaMQscTPQol+A0lzjBF6/dGHlz\n5d1/a/IRvjbFr3/4mUk4SwQZNibcuRYo3PnvEfkVdY0yyfSYK52D5yteST68\n7Wleuarw9cT4bA2LYGZEa2tlP+GGQpVvdQR43UPnPPZaHwoVL4zbTKAkmDQI\nKNQ/sPcK1gfb1gX9CSxiaAzuzO/eDvtyJ5rzjp6M9XfnageMPc+nUaHPmmNu\nbGFO\r\n=Bi9f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210514.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"echo Obsolete.","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"dev-tool samples run samples-dev","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.12","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.1","dependencies":{"tslib":"^2.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.3.0","@azure/core-http":"^1.2.0","@azure/core-tracing":"1.0.0-preview.11"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"apiRefLink":"https://docs.microsoft.com/javascript/api/","skipFolder":true,"productName":"Azure Mixed Reality Authentication","productSlugs":["azure","azure-remote-rendering","azure-spatial-anchors"],"disableDocsMs":false,"customSnippets":{"prerequisites":"snippets/prerequisites.md"},"requiredResources":{"Azure Object Anchors account":"https://docs.microsoft.com/azure/object-anchors/quickstarts/get-started-model-conversion#create-an-object-anchors-account","Azure Spatial Anchors account":"https://docs.microsoft.com/azure/spatial-anchors/quickstarts/get-started-hololens?tabs=azure-portal#create-a-spatial-anchors-resource","Azure Remote Rendering account":"https://docs.microsoft.com/azure/remote-rendering/quickstarts/convert-model#azure-setup"}},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210514.1_1621039410365_0.6311766742879503","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210609.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210609.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210609.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"b47afd0c96d3de9829dce5ede6f6ca0f3c7cbd88","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210609.1.tgz","fileCount":43,"integrity":"sha512-/2KIPir5Hr5CTHXsArMFoSaF8wRhZonqAduLlAudOJMwO3rbuG3qhrKT2ELnPKBhQycdgzXDMMcj5UNkyj01fg==","signatures":[{"sig":"MEYCIQCKkvA4tNa/z8UtvzMuUwXc7FwHlQstJ/Kof1qdmwiQdwIhALHrAgBQ++unajYHfrnHtQ2t9eodIHumbXbtvu8pJYjK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwV9YCRA9TVsSAnZWagAAfFMP/2my5QT9ZUSXmsiGXP9I\nKUbS2WL0ru6BI5DD2yoHG4qm6wndSQX7JRh8eqM90ivTLD9vNPJWaHZlp6i2\n8PLXXVPKKPX6VkTd+NehUo4hmUMU3lFYj8m6KlT105LXkGh07ncCIaFjA3OI\n7V25ziIPWUJrsw2nVTzwvI/F/dhlmr0Vk35Npv9n3/PCLW0hc5hPJ4qFZpOI\nwoEYNNhIUE2GnzRy30u3faPHD9JOVLJhgUgX7yET4iSk7DHToe+Iv6Skb0DL\nwj+sZtHsaIDKHXJJ+VYxik9GY3xbgrJRhVjgVCMJ57M76E5xzIV2z6Zgj/2d\nBWJ13bc4TZPF/8kJeY50IskrY6C7tfCsPNt3JXctsuoLUDzLn92zamXLhTrm\nLhGIS9ppbJYqHCI+bL/5YJXtyQiYBhMpM3w0GpDuwvyyFGaPDTuELTD+FVie\nvkXtK4Z0RghvMfhaOg5JEPUvvZ+1nPurLiUki0xaT/rR9tdALEZgx5lO6X7a\niTaMx3aD3QvUD5KA6Ay5iXSubw43VfXBZp4Ak/02wl3Au8OLE+TckVye9pP5\n9R7ulkSUzQHC7bnjQ6ucB06YXoghDBUY3/A8crXN/bpLqvRGdnSrGBWY/DHw\ng3pdpENxx9QftXx4dHtjUlYE7KXoRlScPuW6tVA9gEhW45X23X+WwCBJHIHH\nbvGS\r\n=9zeQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210609.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"echo Obsolete.","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"dev-tool samples run samples-dev","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.13","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.0","dependencies":{"tslib":"^2.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.3.0","@azure/core-http":"^1.2.0","@azure/core-tracing":"1.0.0-preview.11"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"apiRefLink":"https://docs.microsoft.com/javascript/api/","skipFolder":true,"productName":"Azure Mixed Reality Authentication","productSlugs":["azure","azure-remote-rendering","azure-spatial-anchors"],"disableDocsMs":false,"customSnippets":{"prerequisites":"snippets/prerequisites.md"},"requiredResources":{"Azure Object Anchors account":"https://docs.microsoft.com/azure/object-anchors/quickstarts/get-started-model-conversion#create-an-object-anchors-account","Azure Spatial Anchors account":"https://docs.microsoft.com/azure/spatial-anchors/quickstarts/get-started-hololens?tabs=azure-portal#create-a-spatial-anchors-resource","Azure Remote Rendering account":"https://docs.microsoft.com/azure/remote-rendering/quickstarts/convert-model#azure-setup"}},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210609.1_1623285591872_0.038211776559638366","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210611.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210611.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210611.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"7c66a93f3c921ce3f82a8f761ce6e38667d8fcfd","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210611.1.tgz","fileCount":43,"integrity":"sha512-EEYLX9yZ76ocY0T3KYhnFZxaoTPQBU9cfm+e7hOH1DtveMP2PVRLOeRTrrrjhT3qn91CF7tYECpPzlTE/EjQ2g==","signatures":[{"sig":"MEQCICZr/nRvJHIwe+uiMeoYBPeqQMfU5hugOHhHWR+ldiOGAiB/hbV7L8pNNzPDjRBzoc6F11qG4X/3Y40xZ40DmN6CMQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119753,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgxAJ0CRA9TVsSAnZWagAA33AP/2NZCySJogh23eL9DqZr\nvLv7HyIm2b/pSxIXinBBwyGlL1Oj9UrTVmMAmpA5BoK7qDqeacpQHNUd++qO\nIeCMN8yB1hThN8/PrDemUIhE2kwXvKpS8ECdrfM/l5gBKOa1rO3dAxxHdG0l\n4zWmMahLBqpllQN2t+cJWNemkXeuiK9CuYiKZjadvbArLn8bflzZO/kSGB2i\nyIVOIW/96ZrWZJufeURxqIKJ9xjLKEt7fQLLGzdi1RytVR+ii7Ug7dG9AUu2\nnzjZeTkPbZGFGITJq7R/Ed2Dp8A41OLqEjOCgCagvbSrUVR6ej/lLgPpADua\nBDxDEuubj79n8mppH/EF0GDPlRq3mxff2Br4QxDcg0Bvr6rLmjSrEzRPGX1u\ncP0QTnxWuBgjr3ue/SjipPksutsLzHRvW4vf4LKrhIJeRZoVkNvuWEgmexAb\nwMFN2m8ApoLlpV6z1KO2P1OQ1fKyalOzLr3G10KLa+OPuq4kNeh/ne7peOz4\n6ez7oCucJAUqtW2wIiUC2Gl/I/Y2vVE0FIZPMn+jCQJyDcummXtCVWO2MD20\npjST2fLskSGC46vXe772vOyFL/yz6/6Cby+VTm1aEkPSTVxjWzYzleGqQntv\nkpDPYHCcjPgbe78lrDrLdcOsw2RFNs8umpYCCx/rmLzh4OTh1SUcemb4of+U\nLMqd\r\n=db6o\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210611.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"echo Obsolete.","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"dev-tool samples run samples-dev","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","//metadata":{"constantPaths":[{"path":"src/generated/mixedRealityStsRestClientContext.ts","prefix":"packageVersion"},{"path":"src/constants.ts","prefix":"SDK_VERSION"},{"path":"swagger/README.md","prefix":"package-version"}]},"_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.13","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.0","dependencies":{"tslib":"^2.2.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.3.0","@azure/core-http":"^1.2.0","@azure/core-tracing":"1.0.0-preview.11"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"apiRefLink":"https://docs.microsoft.com/javascript/api/","skipFolder":true,"productName":"Azure Mixed Reality Authentication","productSlugs":["azure","azure-remote-rendering","azure-spatial-anchors"],"disableDocsMs":false,"customSnippets":{"prerequisites":"snippets/prerequisites.md"},"requiredResources":{"Azure Object Anchors account":"https://docs.microsoft.com/azure/object-anchors/quickstarts/get-started-model-conversion#create-an-object-anchors-account","Azure Spatial Anchors account":"https://docs.microsoft.com/azure/spatial-anchors/quickstarts/get-started-hololens?tabs=azure-portal#create-a-spatial-anchors-resource","Azure Remote Rendering account":"https://docs.microsoft.com/azure/remote-rendering/quickstarts/convert-model#azure-setup"}},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210611.1_1623458419880_0.10586620404348523","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210618.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210618.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210618.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"80180fdaa053b1c64510dff4748cb38e1095c732","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210618.1.tgz","fileCount":43,"integrity":"sha512-qT4Llo0SN5Y42TxuM9mihGkYMN1GjXEVSFs5sMuiC0llzTBOep6t9G7hXo/djcw9b7nhGTwPCxz4PWEZGd4rIQ==","signatures":[{"sig":"MEUCIBwmOrljyB7n77ZC2TgpIFdgBgPUtQ2qHYmCB4IJB+eGAiEArMb2RVX1F1cEkQ2n6NHXb0cu7y1VwskdhfzIgY2im8I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzTzbCRA9TVsSAnZWagAAnAAQAIXRI65fjlVgBXHXzS33\nBtZnk4rT5nMKNzOex+zTuWqjCWJKFsQtYXpuhfAquHOtfsDhnsFBwiep1ia8\nbTIAFy5h2lxDpmB6MLoSft8VnZ1v+Z1wvhPV9hlFFwNSa31XgPfNCYMEzwKw\nt1N6DeC1K4bhJl/HdG/WWtjg/HDWqPFFljlAEAsNxJcgtYA3mHXnPJopj/9B\n8vrLmV4WFWTEuv69WdAjbwQ18QcaLeQn6V5MhJQiNYBobDIehdjFufIwAg12\nuY5dwAuCUNRlEqkvpCgVnQo/a8A+60jJAyZJPNio6nTcb0TrW9s26AT3uu6k\n9Ab8PK3RrvCZNEkGTFfGCFExi3oCT5t2+HT8s0R0qSxvigRjLIEzdn2siZ1Y\n7NkTtL49kIW9I6904z9Z5v9Ha107N+Ffm9RDW21P+PehErDV5OKk6O9F06Dg\nZUrdhFfPD86XOb9v2LU9szseeOUGaB+XqK9x8Ti7eh6tfoIACNWeSQWqxMpY\nHAsVMuvVhbZn9KUfxKVLZTkRFQJL/A0Cn+is+Dbda8wiuvHBJOijLBwsKN7R\nN51RqXG8Pcq7H+pqg8vfGGp+ubireUCEluigWKykAKrv8UUDSooquA75Gxpe\nDiSWwWTauhev6hR3vWgGoNcb87bC2vR+aslVPDZhmb0xyDtaH0Kxf6WNnyuo\nY4P1\r\n=bsb4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication-1.0.0-alpha.20210618.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"echo Obsolete.","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"dev-tool samples run samples-dev","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","//metadata":{"constantPaths":[{"path":"src/generated/mixedRealityStsRestClientContext.ts","prefix":"packageVersion"},{"path":"src/constants.ts","prefix":"SDK_VERSION"},{"path":"swagger/README.md","prefix":"package-version"}]},"_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.13","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.0","dependencies":{"tslib":"^2.2.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.3.0","@azure/core-http":"^1.2.0","@azure/core-tracing":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"apiRefLink":"https://docs.microsoft.com/javascript/api/","skipFolder":true,"productName":"Azure Mixed Reality Authentication","productSlugs":["azure","azure-remote-rendering","azure-spatial-anchors"],"disableDocsMs":false,"customSnippets":{"prerequisites":"snippets/prerequisites.md"},"requiredResources":{"Azure Object Anchors account":"https://docs.microsoft.com/azure/object-anchors/quickstarts/get-started-model-conversion#create-an-object-anchors-account","Azure Spatial Anchors account":"https://docs.microsoft.com/azure/spatial-anchors/quickstarts/get-started-hololens?tabs=azure-portal#create-a-spatial-anchors-resource","Azure Remote Rendering account":"https://docs.microsoft.com/azure/remote-rendering/quickstarts/convert-model#azure-setup"}},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210618.1_1624063195232_0.8355037774149721","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210622.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210622.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210622.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"51155a3f950ee46bb9f35b5f1383d46a68e27810","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210622.1.tgz","fileCount":43,"integrity":"sha512-pdROf1PZmt1H2ukgZqmorgtoOanxJyeYUn597aAaGAqeEi1fBbE11K6uW5scU2cBk7kqoGCCj4xCdFva/LzyvA==","signatures":[{"sig":"MEUCIQCPESzxAAA/gR8ECG8NBsABuzsrpVIzbO8dQE6ojfZKYwIgfrCKibFycAZFhoyHliqge6OqJVG7KXEc3JDkMlK6sW4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0oNLCRA9TVsSAnZWagAAV4IQAIX3I4tGKui7lw4rkBIN\nauxtO0C8q1IK2hORPEVXHNwLykbeq0lYO98bRAU3cJlL7GZfwxcoNh9DSdyG\nYE5xmN2LOtCDB47z60T/K4mbrOgw1AVL7HCNDHhquMM7f2HhUdunuw9r3QlD\nUMfEM/bhZGb9SXzpXllepxB3BaFfZYDnuthiD0LPmNX8wbWGwK583QhRrWkZ\n35P0AaN8dZEPpfXzM8lGJ6P4ZipRDw7n3NEhtbByXjQXC3NJtX8yPRA1f/VE\nKPj8m+ba3S7h6YY1WDqfZYNu0W0lZ41ClLBfMeYln12Mu0TtXXCCjYkivLCS\naYao6JG+rMwKO100BTiirEToU6t/QaeHywe/c8jYwow/QfBZJaUoVl/B+NsU\nZRZQKTuGr+Y4S2IZsAbO/T5ERMwrOuz9+mIhchvlqT3gRhqqfCMzYbA8su2w\npnv0TNuFiLVAmOxdKeaRQzA6S45quniTHPeDIIgyXtVEdfDlwLoDgaTte9Zi\nozb21ZpQnpsHVk8cYFSTs415u9G8sBmamSIB4DHE/MWjx850GdSUe7RCel0/\n/exBl/rK6vtIPQr9CxYKucPUo0sY5YKAbin/7vjgQ90smqPj1hUABc3PStYZ\n3p5z6Owl2Gxva845F2U/i9EuLJKW7gfTD6RrelgG6MU6tEaQV+Aw8XGXpB4A\ndtJg\r\n=PnGM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication/azure-mixedreality-authentication-1.0.0-alpha.20210622.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"echo Obsolete.","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"dev-tool samples run samples-dev","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","//metadata":{"constantPaths":[{"path":"src/generated/mixedRealityStsRestClientContext.ts","prefix":"packageVersion"},{"path":"src/constants.ts","prefix":"SDK_VERSION"},{"path":"swagger/README.md","prefix":"package-version"}]},"_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.13","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.1","dependencies":{"tslib":"^2.2.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.3.0","@azure/core-http":"^1.2.0","@azure/core-tracing":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"apiRefLink":"https://docs.microsoft.com/javascript/api/","skipFolder":true,"productName":"Azure Mixed Reality Authentication","productSlugs":["azure","azure-remote-rendering","azure-spatial-anchors"],"disableDocsMs":false,"customSnippets":{"prerequisites":"snippets/prerequisites.md"},"requiredResources":{"Azure Object Anchors account":"https://docs.microsoft.com/azure/object-anchors/quickstarts/get-started-model-conversion#create-an-object-anchors-account","Azure Spatial Anchors account":"https://docs.microsoft.com/azure/spatial-anchors/quickstarts/get-started-hololens?tabs=azure-portal#create-a-spatial-anchors-resource","Azure Remote Rendering account":"https://docs.microsoft.com/azure/remote-rendering/quickstarts/convert-model#azure-setup"}},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210622.1_1624408906739_0.904105398632062","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210624.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210624.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210624.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"9bd48b92f641312aedb0b4488c4cfe9d48767e92","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210624.1.tgz","fileCount":43,"integrity":"sha512-fWMJzLAFn0GKW338Dp642HyIVGmqK4zRHy4wb5oqW+Y8wvgpj9ZQUcwon0Q87kdsOpPT3E2lVtDnjjReT8xWtQ==","signatures":[{"sig":"MEUCIHjSQbz9EXaaHzlx7Choy65LlyRWHrX73zdcOVeYjUVrAiEAuUKBoMDmsEx5aAAzQ4bIUdQYB2Xr46HsHX2MHkkfP+o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1SaVCRA9TVsSAnZWagAAWLQQAI92QrQIomM7+4F9lATG\nyvozXWoquydr3EODLIgWNRDb5ZKuFDIOTehALQZ8q8X/Y5uLGSgLlxrP8+85\nHQOxx+N+KCUM2lnN310evyxlrzpnhu2L3y+tEW3ymq1/uJbu+A/ClfLkCJGc\nG4uiLsK2/LqgHkYr34zmF9jFGZjBfIlz6Ctht+sQKaB5mViVwsHxYr4X7yoH\nm2dfoAZsWvidx/3lj1E801NCiO8pAtxEvnlR9seMsOiSNyCaqvvxdhj+fnYN\nWV/10wCZFIxS+1dZoKoAEqvriqtmv0735+26EZgfN6ins2Wsh3vp6O+TqEPn\nzMteREYU1Uz2LLhq44DQYh2YtiSPPRu2PIuY/lHFRCtPQrb2uMpmLnC1SaJi\nbMmT72hWGW9wufKi5XrSGZUMSlNnYf3ogsVHV6DlQ9TYFie6kcONAqq7B/Tj\nohOE6L9A3LUicOrPLsprozHi8XuVfcX1iMzN9Oe1rSX1tXAI1PzHYCN8FLgo\nVN4S7J9G47b8Nk7WDm4CmSn9bgoCvYIftZhjc+aFLtBc3hv52ql2kehiOKr1\nGhzYM00XJ3WNaSUPG/LBK82gMALqMTCDpSQsefiETFc827ZI6qC0LC4cn0Eb\nae/MTnevSLT9GV8IWbW7GU3d8ei+iutfsXonlgMZoZnLYQORdXNgJ5hh+FFv\nChY4\r\n=48Pf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication/azure-mixedreality-authentication-1.0.0-alpha.20210624.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- Node.js version 8.x.x or higher\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"echo Obsolete.","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"dev-tool samples run samples-dev","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","//metadata":{"constantPaths":[{"path":"src/generated/mixedRealityStsRestClientContext.ts","prefix":"packageVersion"},{"path":"src/constants.ts","prefix":"SDK_VERSION"},{"path":"swagger/README.md","prefix":"package-version"}]},"_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.13","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.1","dependencies":{"tslib":"^2.2.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.3.0","@azure/core-http":"^2.0.0-alpha","@azure/core-tracing":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"apiRefLink":"https://docs.microsoft.com/javascript/api/","skipFolder":true,"productName":"Azure Mixed Reality Authentication","productSlugs":["azure","azure-remote-rendering","azure-spatial-anchors"],"disableDocsMs":false,"customSnippets":{"prerequisites":"snippets/prerequisites.md"},"requiredResources":{"Azure Object Anchors account":"https://docs.microsoft.com/azure/object-anchors/quickstarts/get-started-model-conversion#create-an-object-anchors-account","Azure Spatial Anchors account":"https://docs.microsoft.com/azure/spatial-anchors/quickstarts/get-started-hololens?tabs=azure-portal#create-a-spatial-anchors-resource","Azure Remote Rendering account":"https://docs.microsoft.com/azure/remote-rendering/quickstarts/convert-model#azure-setup"}},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210624.1_1624581781350_0.44614738638778095","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210625.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210625.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210625.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"509c0f62739e7930ebe20aff7ec824a57f6a3db7","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210625.1.tgz","fileCount":43,"integrity":"sha512-oQXXDHkGt31Iv9bRhXlaGc7rmF96m9cy2cmCOe/ManhWcuHeE2UQaoS6Wti7/tc7bA2GUEkKsZmrHKtk/XGoIw==","signatures":[{"sig":"MEQCIDHgz3yUDADwMXZCA6Gb+3+M/zR0jjDg3RiK89eV2SLpAiAQDzgF85NfTtopkH6TE+mIrBJ+Y5apDhr5OHaSK+GPYg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119769,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1nlTCRA9TVsSAnZWagAAgBoP/A32rvHbpmgxDr5WjCny\ncbkld0FJH187Tls5OA8rt7saDeDkHIyILwvxR2HFNy8o5Z3l9If+VcZMKXEC\nRI+mmVliqjtA/eblCGZvFP8wAf2+2oSg5gymQrRTBeN6T2t8ZiagQJRP1OPh\nb7xj9DJ2aHVM6sw5g0cOzVRmQ3t6atgEb+WOLBZbT3EV6ZmRzNMKNCqNWxKz\n6Yn2G86WRF7nC8Pcic00zseFVojMamsaXSNWzUe+PYrdurvNwyYIUjhzv+VR\ntCmfUXPnIK2HtWibs7fJskyXwgC6K07qkyB2rKzAncteX5iE1N+JeUv2ATZj\nuMmqM4yNjOZkHicc6nlks6VU3jKMcFfhJKEjUbtuKBUiK70KjAuK5ZR0Olci\ndNKIWUhmwiTajcWqDHglKI+ofDFd2WxH2jiDSD3UpgfptZFelZWLu8V9rdVA\n3BnIxH7RJxIrT1E09LMd3jThReRTL/gzMDiHiKIGuy4NSS5FhpZjpddpR4nW\n3aCutSunm7OzQMZN14NC1farg35uuVb2Cs/n3VXbMuCF/0FHogDHIuEbikfx\n+rsuxarFow6+P9vqVNh49lRcR8AQX/oWbwZR38MtU1UwZp4Ia9IoCwYp0G+i\n8MiDJt32du0JLyfCO4bv+dZyZOl+TPUgetxHxNLTkIb1Ks+gGEItSDq6ygRQ\nr608\r\n=qF9A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication/azure-mixedreality-authentication-1.0.0-alpha.20210625.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- [LTS versions of Node.js](https://nodejs.org/about/releases/)\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"echo Obsolete.","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"dev-tool samples run samples-dev","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","//metadata":{"constantPaths":[{"path":"src/generated/mixedRealityStsRestClientContext.ts","prefix":"packageVersion"},{"path":"src/constants.ts","prefix":"SDK_VERSION"},{"path":"swagger/README.md","prefix":"package-version"}]},"_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.13","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.1","dependencies":{"tslib":"^2.2.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.3.0","@azure/core-http":"^2.0.0-alpha","@azure/core-tracing":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"apiRefLink":"https://docs.microsoft.com/javascript/api/","skipFolder":true,"productName":"Azure Mixed Reality Authentication","productSlugs":["azure","azure-remote-rendering","azure-spatial-anchors"],"disableDocsMs":false,"customSnippets":{"prerequisites":"snippets/prerequisites.md"},"requiredResources":{"Azure Object Anchors account":"https://docs.microsoft.com/azure/object-anchors/quickstarts/get-started-model-conversion#create-an-object-anchors-account","Azure Spatial Anchors account":"https://docs.microsoft.com/azure/spatial-anchors/quickstarts/get-started-hololens?tabs=azure-portal#create-a-spatial-anchors-resource","Azure Remote Rendering account":"https://docs.microsoft.com/azure/remote-rendering/quickstarts/convert-model#azure-setup"}},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210625.1_1624668498887_0.3635701571485279","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210628.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210628.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210628.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"fdbc68db2277bb7a5dd9d8caa8cce9f6a4e07546","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210628.1.tgz","fileCount":43,"integrity":"sha512-qEQbKu/hgCx79VIubTqkkP+xj0L+wPDTiNHBjQV6RNAbp6t0lrFYtdDgvE9C02YY3ajsUh/q6hTCPCPgex71SQ==","signatures":[{"sig":"MEYCIQDmmR7depyNDmlVVn/Z/1mx6/wCj6OeiDvmI9mWo2FXlwIhAIkR5Bu+y0vaB+vxVvLQ2eRicMOO5RJZFEx7Ajgwq4Cq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2m1fCRA9TVsSAnZWagAAsYYP/j0vqL5cfcPrE4Ok5P0F\nUOCL8c/zmJatawNoWDoJ0NZIwKGsVuU6R3dNvlS9ycqsiCSzl2LOm2Tgltul\nziPFOXS2/Gj36oubjQGnUA8SJvmr/dzHRFPIXbBPCdzdHgnkT0vpzr6V4AYp\nwGPX2rTzebsLMOVbL49eMCP/ZsnjpToBRAfOreQtNoZz35Fs+Q+vipyKkq57\n/+XWhw/m8189yB01HfKeRtkbEFIP0vC5EbjJoCP0lwyQ9f7e2T4A/4/1dxvr\n5m05xx3R85P8dfWlqA5q/W9chsJCHulR/ZQK2MBJznVWqRlyUciv6ldUR/+z\n8vH5/a0dbvAvkaokZKP8m5kiXMsW/SJ30xRn4nIHJI4Aia4NZdMDjlxRHvYS\npKxmOZqf6x8r9wIrWokHAGE+oQgN0bE9MczfTiTdypocilDQsIrYpkA69+5i\ngwzOVgCPOz3tWA0Ds/FNhNxiZzDmW2N89zGEAzIzaaDFMU6pY9IfWu2VuTj0\niaGGVOqQOlvw+IlJ88BB1vdLR3CUIN+ebLTasIK1AZGBu5lxTkmYZsAjx79s\nLrFX2kW/fiLbn4twLD2vXvStHsswgit2YtjcQKCvxa4OyR2oBG6WRqirdERi\nJVx8xQFSvAwMn4WvSQ96/bnvDG8w3pN3eL+5i85XoRFneudTRrS1rvwP/7SD\nlD+Z\r\n=3FiP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication/azure-mixedreality-authentication-1.0.0-alpha.20210628.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- [LTS versions of Node.js](https://nodejs.org/about/releases/)\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=12.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"echo Obsolete.","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"dev-tool samples run samples-dev","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","//metadata":{"constantPaths":[{"path":"src/generated/mixedRealityStsRestClientContext.ts","prefix":"packageVersion"},{"path":"src/constants.ts","prefix":"SDK_VERSION"},{"path":"swagger/README.md","prefix":"package-version"}]},"_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.13","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.1","dependencies":{"tslib":"^2.2.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.3.0","@azure/core-http":"^2.0.0-alpha","@azure/core-tracing":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^12.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"apiRefLink":"https://docs.microsoft.com/javascript/api/","skipFolder":true,"productName":"Azure Mixed Reality Authentication","productSlugs":["azure","azure-remote-rendering","azure-spatial-anchors"],"disableDocsMs":false,"customSnippets":{"prerequisites":"snippets/prerequisites.md"},"requiredResources":{"Azure Object Anchors account":"https://docs.microsoft.com/azure/object-anchors/quickstarts/get-started-model-conversion#create-an-object-anchors-account","Azure Spatial Anchors account":"https://docs.microsoft.com/azure/spatial-anchors/quickstarts/get-started-hololens?tabs=azure-portal#create-a-spatial-anchors-resource","Azure Remote Rendering account":"https://docs.microsoft.com/azure/remote-rendering/quickstarts/convert-model#azure-setup"}},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210628.1_1624927581873_0.8789692077166509","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210630.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210630.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210630.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"b396e564e06d19f70d0fca3c48a03eb7ed2615b8","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210630.1.tgz","fileCount":43,"integrity":"sha512-r2mgzSrFERVLNmtcoucr4I9KlRN2NBEetR5LTiYsktjC3k6gBrxlvSeWEUulfc5AvmDYJmztMHcxVxEJjVTLhA==","signatures":[{"sig":"MEYCIQDiUN8N8UqZS6SNaSe61etxKq7nZu3h8avOcBuSYZpDDwIhALYoUpBIzuF63M2hxL6mOO0MVSqwbmn222jUiMExfG4n","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119769,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3RC6CRA9TVsSAnZWagAAJe0P/jaQ+J3J3bxARElpn2ll\ngK58hxqyoNFDhQv6sbC6+1Ii2QgpmzMT+R86AstV/aGM4VYh1YFRMrD0SUd6\nvvIF222ACWzrZR/DmaeFsGDvuqzIkoTb3928IeIhVn0fpwhpim7btfNEFhDi\n6nTTqVe1P9OEKTIfmHYDhm30XnOt6+MSGGG2zZnesC9+ho/RnAzB2PJoa5GY\n8db2ftN2pYGOp1FaaVVKm4qVSzCXBnoqlcBZPLloMzjJAcyzAqxzJd1ogmrh\nP0625J3F+gUxi8N5jcZF2ncRJagtx8Aq3BVWDtJ9SujqIi/8S2HMwOmgDBxj\nddA7tPWNg5KOgrFhgXuj0cYa4boAvRSEv+BagbnPyvbaC8oME4N1uV6tGWVS\nuCS5SSkmHWMl/AFxugojnSfTlWH4ipN8NYyAH2kxt+9J3zNWvIsBnBMlm1Pa\np1M5Jt2uJsp/O5OY6kOs2x7KHDG8QwqRNs6P2jiqPL10mw+xExwvR+NjiUi9\nGx058j5tk8YHQtAVBjmCN0OWw5LBNZifH2TijSI2TC63thw9t2CmzTSPrMqq\nXpAxl9x5JZVJYWaRBBGXhsp0JDCYOHd8uXHfDOu65XjaIwS/kci21VVsHUc9\n5wTbTJF8ddtjXBxDPUTcS3K6fAFxL4a5agTiWqLq2KA6CYNqGl0O6fPfXK6Z\ndVkH\r\n=CxZD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication/azure-mixedreality-authentication-1.0.0-alpha.20210630.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\n[Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/) |\n[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) |\n[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) |\n[Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- [LTS versions of Node.js](https://nodejs.org/about/releases/)\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=12.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"echo Obsolete.","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"dev-tool samples run samples-dev","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","//metadata":{"constantPaths":[{"path":"src/generated/mixedRealityStsRestClientContext.ts","prefix":"packageVersion"},{"path":"src/constants.ts","prefix":"SDK_VERSION"},{"path":"swagger/README.md","prefix":"package-version"}]},"_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.13","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.1","dependencies":{"tslib":"^2.2.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.3.0","@azure/core-http":"^2.0.0","@azure/core-tracing":"1.0.0-preview.12"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^12.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"apiRefLink":"https://docs.microsoft.com/javascript/api/","skipFolder":true,"productName":"Azure Mixed Reality Authentication","productSlugs":["azure","azure-remote-rendering","azure-spatial-anchors"],"disableDocsMs":false,"customSnippets":{"prerequisites":"snippets/prerequisites.md"},"requiredResources":{"Azure Object Anchors account":"https://docs.microsoft.com/azure/object-anchors/quickstarts/get-started-model-conversion#create-an-object-anchors-account","Azure Spatial Anchors account":"https://docs.microsoft.com/azure/spatial-anchors/quickstarts/get-started-hololens?tabs=azure-portal#create-a-spatial-anchors-resource","Azure Remote Rendering account":"https://docs.microsoft.com/azure/remote-rendering/quickstarts/convert-model#azure-setup"}},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210630.1_1625100473711_0.6860552095503223","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210706.1":{"name":"@azure/mixedreality-authentication","version":"1.0.0-alpha.20210706.1","keywords":["azure","cloud","typescript","mixedreality"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/mixedreality-authentication@1.0.0-alpha.20210706.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"13ac18c9da3bf0fbe132b810789e1add12eebe73","tarball":"https://registry.npmjs.org/@azure/mixedreality-authentication/-/mixedreality-authentication-1.0.0-alpha.20210706.1.tgz","fileCount":43,"integrity":"sha512-jeleoa7M+eelS0aCdY+3VF9lK/DaTflcqHMz8dHQRjvBFc/FBzRR/LMhSagnvS5e+rUbJkC9TofvXEd48W2TDg==","signatures":[{"sig":"MEYCIQCr2wyGbpSozH9Bhj+ZfeT2+cWAbgpmzJVZznEa/oxfewIhAKaM8Q2f8GXhnQuV6tZZXozwSOavQWETODFK0Ai1n109","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5Pl7CRA9TVsSAnZWagAAp/8P/jfhaVsttIKBkXLVyU/d\nJpqjFeieDTcPOBUn/kwUNiAlXFYSanjaKZcuNF5xg+Vx/XF3gytRgYXc+jez\nttHJIRipfCHGB+86y9GCdDdCdoltqODm/8gql/bKXLurVDYfbN2SQka9rUAE\n6fMsfNjgJ3H2iU4BlDaJdtBRgPmuwisAVJWMGmPcn0Cq4wyJB90j2KObLPDJ\nhIqhV9xpp0t5s8BxNmz27IndsfJji4R2ghzrP3mbZEmIveJggWzV89YTw9mn\nmd2FbvbmWVXuH1jv4XyEqI+SVuUtiTs+kkcjuDuP7WvgnrVjIP5PBhwf/Xtw\nA18FD39Sdm4NXklsImuQYEZhA3i6AwE6CWcNbtTqKmHbasIN+mCYxyjsbRfu\n5okWRjLEeOOG9GvvNttnsOVzd/rH0MZg13XjiFOSzSXtNDK1uICTCWQCXLcI\nFqznZ33WMjB/1cET7RfXCdFBateA34iqSvdKLn5LyLqzcn/pQglYihfefXBd\nBG1h9DSM4JaA/KXXbittyneDUAChlrWO9uFqEYiogLRvlpb2Ui/ia17Mrr3O\nKe1zFl08x3QY6yoqgxAKH8wS1lqeBaUAUU93sQygrPHWbKoSDfeztv70c5HI\nKftbhkjV12sg+ewSRxulqtcSIACi/8hj4TAwynqMBd53sMbJ5QbT5GTm9FTq\nJapS\r\n=RFg8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-mixedreality-authentication/azure-mixedreality-authentication-1.0.0-alpha.20210706.1.tgz","types":"types/mixedreality-authentication.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Mixed Reality Authentication client library for JavaScript\n\nMixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security\ntoken service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access\ntoken from the STS that can be used to access Mixed Reality services.\n\nKey links:\n- [Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/)\n- [Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication)\n- [API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs)\n- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/samples)\n\n![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png)\n\n## Getting started\n\n### Currently supported environments\n\n- [LTS versions of Node.js](https://nodejs.org/about/releases/)\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/):\n  - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/)\n  - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/)\n- Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity].\n\n### Install the `@azure/mixedreality-authentication` package\n\nInstall the Azure Mixed Reality Authentication client library for JavaScript with `npm`:\n\n```bash\nnpm install @azure/mixedreality-authentication\n```\n\n### Create and authenticate a `MixedRealityStsClient`\n\nTo create a client object to request an access token for a Mixed Reality service, you will need the `account identifier`\nand `account domain` of your Mixed Reality service resource and a `credential`.\n\nMixed Reality services support a few different forms of authentication:\n\n- Account Key authentication\n  - Account keys enable you to get started quickly with using Mixed Reality services. But before you deploy your application\n    to production, we recommend that you update your app to use Azure AD authentication.\n- Azure Active Directory (AD) token authentication\n  - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use\n    user-based Azure AD authentication in your app. You then grant access to your Mixed Reality accounts by using your\n    existing Azure AD security groups. You can also grant access directly to users in your organization.\n  - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this\n    method for production applications because it allows you to avoid embedding the credentials for access to a Mixed\n    Reality service in your client application.\n\nSee [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information.\n\n#### Using account key authentication\n\nUse the [Azure Portal][azure_portal] to browse to your Mixed Reality service resource and retrieve an `account key`.\n\nOnce you have an account key, you can use the `AzureKeyCredential` class to authenticate the client as follows:\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n```\n\n> Note: Account key authentication is **not recommended** for production applications.\n\n#### Using an Azure Active Directory Credential\n\nAccount key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory\nusing the [Azure Identity library][azure_identity]. This is the recommended method for production applications. To use\nthe [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with\nthe Azure SDK, please install the `@azure/identity` package:\n\n```bash\nnpm install @azure/identity\n```\n\nYou will also need to [register a new AAD application][register_aad_app] and grant access to your Mixed Reality resource\nby assigning the appropriate role for your Mixed Reality service to your service principal.\n\nSet the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:\n`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.\n\n```js\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\nconst { DefaultAzureCredential } = require(\"@azure/identity\");\n\nconst client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential());\n```\n\n## Key concepts\n\n### MixedRealityStsClient\n\nThe `MixedRealityStsClient` is the client library used to access the Mixed Reality STS to get an access token.\n\nTokens obtained from the Mixed Reality STS have a lifetime of **24 hours**.\n\n### Return Value\n\nThe return value for a successful call to `getToken` is an `GetTokenResponse`, which is an `AccessToken` from\n[@azure/core-http](https://www.npmjs.com/package/@azure/core-http).\n\n## Examples\n\n### Retrieve an access token\n\n```js\nconst { AzureKeyCredential } = require(\"@azure/core-auth\");\n\nconst { MixedRealityStsClient } = require(\"@azure/mixedreality-authentication\");\n\nconst accountId = \"<ACCOUNTD ID>\";\nconst accountDomain = \"<ACCOUNT_DOMAIN>\";\nconst accountKey = \"<ACCOUNT_KEY>\";\n\nconst client = new MixedRealityStsClient(\n  accountId,\n  accountDomain,\n  new AzureKeyCredential(accountKey)\n);\n\nconst token = await client.getToken();\n```\n\nSee the authentication examples [above](#authenticate-the-client) or [Azure Identity][azure_identity] for more complex\nauthentication scenarios.\n\n#### Using the access token in a Mixed Reality client library\n\nSome Mixed Reality client libraries might accept an access token in place of a credential. For example:\n\n```js\n// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves\n// a Mixed Reality access token from a web service. The web service would use the\n// MixedRealityStsClient and credentials to obtain an access token to be returned\n// to the client.\nconst accessToken = await GetMixedRealityAccessTokenFromWebService();\n\nconst account = new SpatialAnchorsAccount(accountId, accountDomain);\nconst client = new SpatialAnchorsClient(account, accessToken);\n```\n\nNote: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the\ndocumentation for the client library you're using to determine if and how this might be supported.\n\n## Troubleshooting\n\n### Logging\n\nEnabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:\n\n```javascript\nimport { setLogLevel } from \"@azure/logger\";\n\nsetLogLevel(\"info\");\n```\n\nFor more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\nIf you'd like to contribute to this library, please read the\n[contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to\nbuild and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity\n[register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication\n[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png)\n","browser":{"./dist-esm/test/utils/env.js":"./dist-esm/test/utils/env.browser.js"},"engines":{"node":">=12.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"echo Obsolete.","unit-test:node":"mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"","execute:samples":"dev-tool samples run samples-dev","generate:client":"autorest --typescript --v3 swagger/README.md","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","//metadata":{"constantPaths":[{"path":"src/generated/mixedRealityStsRestClientContext.ts","prefix":"packageVersion"},{"path":"src/constants.ts","prefix":"SDK_VERSION"},{"path":"swagger/README.md","prefix":"package-version"}]},"_integrity":"","deprecated":"Package renamed to @azure/mixed-reality-authentication","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"_npmVersion":"6.14.13","description":"Azure client library for Mixed Reality authentication.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.1","dependencies":{"tslib":"^2.2.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.3.0","@azure/core-http":"^2.0.0","@azure/core-tracing":"1.0.0-preview.12"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","util":"^0.12.1","karma":"^6.2.0","mocha":"^7.1.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^12.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","chai-as-promised":"^7.1.1","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@types/chai-as-promised":"^7.1.0","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","@azure/test-utils-recorder":"^1.0.0-alpha","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"apiRefLink":"https://docs.microsoft.com/javascript/api/","skipFolder":true,"productName":"Azure Mixed Reality Authentication","productSlugs":["azure","azure-remote-rendering","azure-spatial-anchors"],"disableDocsMs":false,"customSnippets":{"prerequisites":"snippets/prerequisites.md"},"requiredResources":{"Azure Object Anchors account":"https://docs.microsoft.com/azure/object-anchors/quickstarts/get-started-model-conversion#create-an-object-anchors-account","Azure Spatial Anchors account":"https://docs.microsoft.com/azure/spatial-anchors/quickstarts/get-started-hololens?tabs=azure-portal#create-a-spatial-anchors-resource","Azure Remote Rendering account":"https://docs.microsoft.com/azure/remote-rendering/quickstarts/convert-model#azure-setup"}},"_npmOperationalInternal":{"tmp":"tmp/mixedreality-authentication_1.0.0-alpha.20210706.1_1625618810749_0.34525381321668736","host":"s3://npm-registry-packages"}}},"time":{"created":"2021-02-17T01:38:14.708Z","modified":"2026-03-19T19:51:13.232Z","1.0.0-alpha.20210216.1":"2021-02-17T01:38:15.190Z","1.0.0-alpha.20210219.1":"2021-02-20T01:39:38.459Z","1.0.0-alpha.20210226.1":"2021-02-27T01:40:20.982Z","1.0.0-alpha.20210301.1":"2021-03-02T01:39:03.724Z","1.0.0-alpha.20210304.1":"2021-03-05T01:44:37.612Z","1.0.0-alpha.20210305.1":"2021-03-06T01:43:11.975Z","1.0.0-alpha.20210311.1":"2021-03-12T01:43:47.695Z","1.0.0-alpha.20210317.1":"2021-03-18T00:43:00.597Z","1.0.0-alpha.20210322.1":"2021-03-23T00:43:30.805Z","1.0.0-alpha.20210329.1":"2021-03-30T00:40:43.515Z","1.0.0-alpha.20210331.1":"2021-04-01T00:45:34.609Z","1.0.0-alpha.20210407.1":"2021-04-08T00:50:50.593Z","1.0.0-alpha.20210430.1":"2021-05-01T00:42:43.626Z","1.0.0-alpha.20210514.1":"2021-05-15T00:43:30.573Z","1.0.0-alpha.20210609.1":"2021-06-10T00:39:52.035Z","1.0.0-alpha.20210611.1":"2021-06-12T00:40:20.032Z","1.0.0-alpha.20210618.1":"2021-06-19T00:39:55.390Z","1.0.0-alpha.20210622.1":"2021-06-23T00:41:46.894Z","1.0.0-alpha.20210624.1":"2021-06-25T00:43:01.482Z","1.0.0-alpha.20210625.1":"2021-06-26T00:48:19.014Z","1.0.0-alpha.20210628.1":"2021-06-29T00:46:23.176Z","1.0.0-alpha.20210630.1":"2021-07-01T00:47:53.854Z","1.0.0-alpha.20210706.1":"2021-07-07T00:46:51.081Z"},"bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"author":{"name":"Microsoft Corporation"},"license":"MIT","homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-authentication/","keywords":["azure","cloud","typescript","mixedreality"],"repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git","directory":"sdk/mixedreality/mixedreality-authentication"},"description":"Azure client library for Mixed Reality authentication.","maintainers":[{"email":"azure-sdk-npmjs@microsoft.com","name":"azure-sdk"},{"email":"npmjs@microsoft.com","name":"microsoft1es"},{"email":"microsoft-oss-publishing@microsoft.com","name":"microsoft-oss-releases"}],"readme":"","readmeFilename":""}