# @azure/core-auth

> Provides low-level interfaces and helper methods for authentication in Azure SDK

Latest version **1.11.0** (published 2026-07-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @azure/core-auth
pnpm add @azure/core-auth
yarn add @azure/core-auth
bun add @azure/core-auth
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.11.0 |
| Published | 2026-07-13 |
| First published | 2019-07-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22.0.0 |
| Dependencies | 3 |
| Unpacked size | 137.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2296 |
| Author | Microsoft Corporation |
| Maintainers | azure-sdk, microsoft1es, microsoft-oss-releases |
| Keywords | azure, authentication, cloud |

## Links

- npm: https://www.npmjs.com/package/@azure/core-auth
- Repository: https://github.com/Azure/azure-sdk-for-js
- Homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-auth/README.md
- Issues: https://github.com/Azure/azure-sdk-for-js/issues
- npm.io page: https://npm.io/package/@azure/core-auth

## Dependencies (3)

- [tslib](https://npm.io/package/tslib.md) ^2.6.2
- [@azure/core-util](https://npm.io/package/@azure/core-util.md) ^1.13.0
- [@azure/abort-controller](https://npm.io/package/@azure/abort-controller.md) ^2.1.2

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 1.11.0 (latest) — 2026-07-13
- 1.10.2-alpha.20260305.6 (dev) — 2026-03-05
- 1.10.2-alpha.20260227.2 — 2026-02-27
- 1.10.2-alpha.20260226.1 — 2026-02-26
- 1.10.2-alpha.20260223.3 — 2026-02-23
- 1.10.2-alpha.20260210.1 — 2026-02-10
- 1.10.2-alpha.20260204.2 — 2026-02-04
- 1.10.2-alpha.20260130.1 — 2026-01-30
- 1.10.2-alpha.20260129.2 — 2026-01-29
- 1.10.2-alpha.20260128.1 — 2026-01-28
- 1.10.2-alpha.20260127.1 — 2026-01-27
- 1.10.2-alpha.20260109.1 — 2026-01-09
- 1.10.2-alpha.20260102.1 — 2026-01-02
- 1.10.2-alpha.20251231.1 — 2025-12-31
- 1.10.2-alpha.20251223.1 — 2025-12-23
- … 467 more at https://npm.io/package/@azure/core-auth/versions

## README

# Azure Core Authentication client library for JavaScript

The `@azure/core-auth` package provides core interfaces and helper methods for authenticating with Azure services using Azure Active Directory and other authentication schemes common across the Azure SDK. As a "core" library, it shouldn't need to be added as a dependency to any user code, only other Azure SDK libraries.

## Getting started

### Installation

Install this library using npm as follows

```
npm install @azure/core-auth
```

## Key Concepts

The `TokenCredential` interface represents a credential capable of providing an authentication token. The `@azure/identity` package contains various credentials that implement the `TokenCredential` interface.

The `AzureKeyCredential` is a static key-based credential that supports key rotation via the `update` method. Use this when a single secret value is needed for authentication, e.g. when using a shared access key.

The `AzureNamedKeyCredential` is a static name/key-based credential that supports name and key rotation via the `update` method. Use this when both a secret value and a label are needed, e.g. when using a shared access key and shared access key name.

The `AzureSASCredential` is a static signature-based credential that supports updating the signature value via the `update` method. Use this when using a shared access signature.

## Examples

### AzureKeyCredential

```ts snippet:ReadmeSampleAzureKeyCredential
import { AzureKeyCredential } from "@azure/core-auth";

const credential = new AzureKeyCredential("secret value");

console.log(credential.key); // prints: "secret value"

credential.update("other secret value");

console.log(credential.key); // prints: "other secret value"
```

### AzureNamedKeyCredential

```ts snippet:ReadmeSampleAzureNamedCredential
import { AzureNamedKeyCredential } from "@azure/core-auth";

const credential = new AzureNamedKeyCredential("ManagedPolicy", "secret value");

console.log(`${credential.name}, ${credential.key}`); // prints: "ManagedPolicy, secret value"

credential.update("OtherManagedPolicy", "other secret value");

console.log(`${credential.name}, ${credential.key}`); // prints: "OtherManagedPolicy, other secret value"
```

### AzureSASCredential

```ts snippet:ReadmeSampleSASCredential
import { AzureSASCredential } from "@azure/core-auth";

const credential = new AzureSASCredential("signature1");

console.log(credential.signature); // prints: "signature1"

credential.update("signature2");

console.log(credential.signature); // prints: "signature2"
```

## Next steps

You can build and run the tests locally by executing `npm run test`. Explore the `test` folder to see advanced usage and behavior of the public classes.

## Troubleshooting

If you run into issues while using this library, please feel free to [file an issue](https://github.com/Azure/azure-sdk-for-js/issues/new).

## Contributing

If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.

---
_Source: https://npm.io/package/@azure/core-auth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
