@mastra/auth-okta 0.2.0-alpha.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @mastra/auth-okta
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Added an `audience` option to `MastraAuthOkta` so bearer-token verification is no longer pinned to the OAuth client ID. ([#21117](https://github.com/mastra-ai/mastra/pull/21117))
8
+
9
+ Previously the provider always required `aud` to equal the client ID, which is the audience of an Okta **ID token**. Okta **access tokens** carry the authorization server's audience instead, so machine-to-machine callers (MCP clients, CI jobs, service-to-service traffic) always got a 401 on an org authorization server. Those callers have no session cookie, so bearer was their only way in.
10
+
11
+ Set `audience` (or the `OKTA_AUDIENCE` environment variable) to the audience your tokens actually carry:
12
+
13
+ ```typescript
14
+ // Before: only ID tokens whose aud is the client ID were accepted
15
+ const auth = new MastraAuthOkta({ domain, clientId, clientSecret, redirectUri });
16
+
17
+ // After: accept access tokens from an org authorization server
18
+ const auth = new MastraAuthOkta({
19
+ domain,
20
+ clientId,
21
+ clientSecret,
22
+ redirectUri,
23
+ audience: 'https://your-org.okta.com',
24
+ });
25
+
26
+ // Or accept both ID tokens from the browser and access tokens from services
27
+ const auth = new MastraAuthOkta({ /* ... */ audience: [clientId, 'api://default'] });
28
+ ```
29
+
30
+ The default is unchanged, so existing setups keep working.
31
+
3
32
  ## 0.2.0-alpha.0
4
33
 
5
34
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/auth-okta",
3
- "version": "0.2.0-alpha.0",
3
+ "version": "0.2.0",
4
4
  "description": "Mastra Okta Auth and RBAC integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -39,9 +39,9 @@
39
39
  "tsdown": "0.22.9",
40
40
  "typescript": "^6.0.3",
41
41
  "vitest": "4.1.10",
42
- "@internal/types-builder": "0.0.96",
43
- "@internal/auth": "0.0.11",
44
- "@internal/lint": "0.0.121"
42
+ "@internal/auth": "0.0.12",
43
+ "@internal/lint": "0.0.122",
44
+ "@internal/types-builder": "0.0.97"
45
45
  },
46
46
  "homepage": "https://mastra.ai",
47
47
  "repository": {