@atlasauth/backend 0.24.0 → 0.26.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.
- package/CHANGELOG.md +39 -1
- package/dist/client/abac.d.ts +521 -0
- package/dist/client/abac.js +146 -0
- package/dist/client/abac.js.map +1 -0
- package/dist/client/access-policies.d.ts +100 -0
- package/dist/client/access-policies.js +29 -0
- package/dist/client/access-policies.js.map +1 -0
- package/dist/client/action-gallery.d.ts +1 -1
- package/dist/client/action-gallery.js.map +1 -1
- package/dist/client/actions.d.ts +129 -6
- package/dist/client/actions.js +4 -0
- package/dist/client/actions.js.map +1 -1
- package/dist/client/analytics-reports.d.ts +215 -0
- package/dist/client/analytics-reports.js +56 -0
- package/dist/client/analytics-reports.js.map +1 -0
- package/dist/client/app-catalog.d.ts +74 -0
- package/dist/client/app-catalog.js +30 -0
- package/dist/client/app-catalog.js.map +1 -0
- package/dist/client/attack-protection.d.ts +10 -0
- package/dist/client/attack-protection.js +8 -0
- package/dist/client/attack-protection.js.map +1 -1
- package/dist/client/audit-events.d.ts +71 -0
- package/dist/client/audit-events.js +28 -0
- package/dist/client/audit-events.js.map +1 -1
- package/dist/client/authz-decisions.d.ts +108 -0
- package/dist/client/authz-decisions.js +40 -0
- package/dist/client/authz-decisions.js.map +1 -0
- package/dist/client/connections.d.ts +507 -0
- package/dist/client/connections.js +164 -0
- package/dist/client/connections.js.map +1 -0
- package/dist/client/credentials.d.ts +8 -0
- package/dist/client/credentials.js.map +1 -1
- package/dist/client/custom-oauth-providers.d.ts +15 -0
- package/dist/client/custom-oauth-providers.js.map +1 -1
- package/dist/client/delegated-ui-proxy.d.ts +25 -0
- package/dist/client/delegated-ui-proxy.js +46 -0
- package/dist/client/delegated-ui-proxy.js.map +1 -0
- package/dist/client/desktop-mfa.d.ts +104 -0
- package/dist/client/desktop-mfa.js +44 -0
- package/dist/client/desktop-mfa.js.map +1 -0
- package/dist/client/devices.d.ts +44 -0
- package/dist/client/devices.js +26 -0
- package/dist/client/devices.js.map +1 -0
- package/dist/client/email-templates.d.ts +1 -1
- package/dist/client/email-templates.js.map +1 -1
- package/dist/client/fga.d.ts +125 -4
- package/dist/client/fga.js +40 -0
- package/dist/client/fga.js.map +1 -1
- package/dist/client/flags.d.ts +101 -0
- package/dist/client/flags.js +104 -0
- package/dist/client/flags.js.map +1 -0
- package/dist/client/groups.d.ts +146 -0
- package/dist/client/groups.js +67 -0
- package/dist/client/groups.js.map +1 -0
- package/dist/client/identity-verification.d.ts +62 -0
- package/dist/client/identity-verification.js +39 -0
- package/dist/client/identity-verification.js.map +1 -0
- package/dist/client/iga.d.ts +436 -0
- package/dist/client/iga.js +82 -0
- package/dist/client/iga.js.map +1 -0
- package/dist/client/index.d.ts +1433 -4
- package/dist/client/index.js +96 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/journeys.d.ts +108 -0
- package/dist/client/journeys.js +35 -0
- package/dist/client/journeys.js.map +1 -0
- package/dist/client/least-privilege.d.ts +95 -0
- package/dist/client/least-privilege.js +28 -0
- package/dist/client/least-privilege.js.map +1 -0
- package/dist/client/log-streams.d.ts +1 -1
- package/dist/client/managed-grants.d.ts +52 -0
- package/dist/client/managed-grants.js +28 -0
- package/dist/client/managed-grants.js.map +1 -0
- package/dist/client/marketing.d.ts +67 -0
- package/dist/client/marketing.js +26 -0
- package/dist/client/marketing.js.map +1 -0
- package/dist/client/mcp-gateways.d.ts +126 -0
- package/dist/client/mcp-gateways.js +47 -0
- package/dist/client/mcp-gateways.js.map +1 -0
- package/dist/client/messaging.d.ts +14 -3
- package/dist/client/messaging.js.map +1 -1
- package/dist/client/mfa-factors.d.ts +120 -0
- package/dist/client/mfa-factors.js +73 -0
- package/dist/client/mfa-factors.js.map +1 -0
- package/dist/client/migrations.d.ts +1 -1
- package/dist/client/migrations.js.map +1 -1
- package/dist/client/network-acls.d.ts +6 -1
- package/dist/client/network-acls.js.map +1 -1
- package/dist/client/network-zones.d.ts +56 -0
- package/dist/client/network-zones.js +29 -0
- package/dist/client/network-zones.js.map +1 -0
- package/dist/client/notifications.d.ts +1 -1
- package/dist/client/notifications.js.map +1 -1
- package/dist/client/oauth-clients.d.ts +187 -3
- package/dist/client/oauth-clients.js +64 -0
- package/dist/client/oauth-clients.js.map +1 -1
- package/dist/client/openfga.d.ts +90 -3
- package/dist/client/openfga.js +27 -1
- package/dist/client/openfga.js.map +1 -1
- package/dist/client/org-role-grants.d.ts +57 -0
- package/dist/client/org-role-grants.js +40 -0
- package/dist/client/org-role-grants.js.map +1 -0
- package/dist/client/organizations.d.ts +52 -0
- package/dist/client/organizations.js +44 -0
- package/dist/client/organizations.js.map +1 -1
- package/dist/client/page-templates.d.ts +78 -0
- package/dist/client/page-templates.js +31 -0
- package/dist/client/page-templates.js.map +1 -0
- package/dist/client/passkey-api.d.ts +73 -0
- package/dist/client/passkey-api.js +34 -0
- package/dist/client/passkey-api.js.map +1 -0
- package/dist/client/policy-bundles.d.ts +105 -0
- package/dist/client/policy-bundles.js +38 -0
- package/dist/client/policy-bundles.js.map +1 -0
- package/dist/client/resources.d.ts +150 -0
- package/dist/client/resources.js +73 -0
- package/dist/client/resources.js.map +1 -0
- package/dist/client/risk-based-mfa.d.ts +147 -0
- package/dist/client/risk-based-mfa.js +30 -0
- package/dist/client/risk-based-mfa.js.map +1 -1
- package/dist/client/roles.d.ts +4 -0
- package/dist/client/roles.js.map +1 -1
- package/dist/client/service-connectors.d.ts +83 -0
- package/dist/client/service-connectors.js +33 -0
- package/dist/client/service-connectors.js.map +1 -0
- package/dist/client/ssf.d.ts +112 -0
- package/dist/client/ssf.js +49 -0
- package/dist/client/ssf.js.map +1 -0
- package/dist/client/sso-onboarding.d.ts +6 -0
- package/dist/client/sso-onboarding.js.map +1 -1
- package/dist/client/users.d.ts +302 -0
- package/dist/client/users.js +125 -0
- package/dist/client/users.js.map +1 -1
- package/dist/client/vault.d.ts +85 -0
- package/dist/client/vault.js +50 -0
- package/dist/client/vault.js.map +1 -0
- package/dist/client/vc.d.ts +136 -0
- package/dist/client/vc.js +43 -0
- package/dist/client/vc.js.map +1 -0
- package/dist/client/webhooks.d.ts +31 -2
- package/dist/client/webhooks.js.map +1 -1
- package/dist/client/workflows.d.ts +131 -0
- package/dist/client/workflows.js +36 -0
- package/dist/client/workflows.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/magic-did.d.ts +5 -0
- package/dist/magic-did.js +49 -0
- package/dist/magic-did.js.map +1 -0
- package/dist/migration-bridge.d.ts +9 -0
- package/dist/migration-bridge.js +28 -2
- package/dist/migration-bridge.js.map +1 -1
- package/dist/migration-presets-g3.d.ts +2 -0
- package/dist/migration-presets-g3.js +254 -0
- package/dist/migration-presets-g3.js.map +1 -0
- package/dist/migration-presets-g4/authentik.d.ts +14 -0
- package/dist/migration-presets-g4/authentik.js +37 -0
- package/dist/migration-presets-g4/authentik.js.map +1 -0
- package/dist/migration-presets-g4/fusionauth.d.ts +2 -0
- package/dist/migration-presets-g4/fusionauth.js +52 -0
- package/dist/migration-presets-g4/fusionauth.js.map +1 -0
- package/dist/migration-presets-g4/hanko.d.ts +12 -0
- package/dist/migration-presets-g4/hanko.js +46 -0
- package/dist/migration-presets-g4/hanko.js.map +1 -0
- package/dist/migration-presets-g4/keycloak.d.ts +16 -0
- package/dist/migration-presets-g4/keycloak.js +37 -0
- package/dist/migration-presets-g4/keycloak.js.map +1 -0
- package/dist/migration-presets-g4/logto.d.ts +12 -0
- package/dist/migration-presets-g4/logto.js +35 -0
- package/dist/migration-presets-g4/logto.js.map +1 -0
- package/dist/migration-presets-g4/ory.d.ts +2 -0
- package/dist/migration-presets-g4/ory.js +67 -0
- package/dist/migration-presets-g4/ory.js.map +1 -0
- package/dist/migration-presets-g4/supertokens.d.ts +13 -0
- package/dist/migration-presets-g4/supertokens.js +35 -0
- package/dist/migration-presets-g4/supertokens.js.map +1 -0
- package/dist/migration-presets-g4/zitadel.d.ts +2 -0
- package/dist/migration-presets-g4/zitadel.js +36 -0
- package/dist/migration-presets-g4/zitadel.js.map +1 -0
- package/dist/migration-presets-g4.d.ts +10 -0
- package/dist/migration-presets-g4.js +30 -0
- package/dist/migration-presets-g4.js.map +1 -0
- package/dist/migration-presets.d.ts +6 -0
- package/dist/migration-presets.js +102 -6
- package/dist/migration-presets.js.map +1 -1
- package/dist/policy-bundle.d.ts +110 -0
- package/dist/policy-bundle.js +289 -0
- package/dist/policy-bundle.js.map +1 -0
- package/dist/request-auth.d.ts +32 -0
- package/dist/request-auth.js +72 -0
- package/dist/request-auth.js.map +1 -0
- package/dist/uma.d.ts +77 -0
- package/dist/uma.js +95 -0
- package/dist/uma.js.map +1 -0
- package/dist/verify.d.ts +2 -0
- package/dist/verify.js.map +1 -1
- package/dist/workos-session.d.ts +30 -0
- package/dist/workos-session.js +123 -0
- package/dist/workos-session.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.G3_BRIDGE_PRESETS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Bridge presets for Firebase / Identity Platform, Supabase, Amazon Cognito,
|
|
6
|
+
* Azure AD B2C, Entra External ID, Appwrite, PocketBase and Nhost, checked against each vendor's
|
|
7
|
+
* token documentation. Registered (replacing the starters) at the end of
|
|
8
|
+
* migration-presets.ts; only a type is imported from there, so there is no
|
|
9
|
+
* import cycle at runtime.
|
|
10
|
+
*
|
|
11
|
+
* A vendor whose browser SDK keeps the session in localStorage / IndexedDB
|
|
12
|
+
* (Firebase, Amplify, MSAL, Supabase SPA, Nhost) has no cookie for a server
|
|
13
|
+
* middleware to read: the browser helpers in `@atlasauth/js`
|
|
14
|
+
* (`exchangeMigrationBrowserSession` with the vendor readers) pick the token up
|
|
15
|
+
* there and call the Frontend API exchange.
|
|
16
|
+
*/
|
|
17
|
+
/** Short-lived vendor tokens nobody refreshes after the switch: accept them (once) for a week past `exp`. */
|
|
18
|
+
const WEEK = 7 * 24 * 3600;
|
|
19
|
+
exports.G3_BRIDGE_PRESETS = [
|
|
20
|
+
{
|
|
21
|
+
id: 'firebase',
|
|
22
|
+
label: 'Firebase Authentication / Identity Platform (ID tokens)',
|
|
23
|
+
mode: 'jwt',
|
|
24
|
+
vars: { project_id: 'Firebase / Google Cloud project id' },
|
|
25
|
+
jwt: {
|
|
26
|
+
issuer: 'https://securetoken.google.com/{project_id}',
|
|
27
|
+
keysUrl: 'https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com',
|
|
28
|
+
audience: ['{project_id}'],
|
|
29
|
+
algorithms: ['RS256'],
|
|
30
|
+
// `sub` and `user_id` both carry the uid. Firebase ID tokens have no jti:
|
|
31
|
+
// the whole token is spent in the single-use ledger.
|
|
32
|
+
claims: { subject: 'sub', email: 'email', emailVerified: 'email_verified', name: 'name' },
|
|
33
|
+
// ID tokens live an hour and the Firebase SDK refreshes them; after the switch nothing does.
|
|
34
|
+
expiredGraceSeconds: WEEK,
|
|
35
|
+
},
|
|
36
|
+
// Firebase keeps sessions in IndexedDB; `__session` is the cookie apps behind
|
|
37
|
+
// Firebase Hosting conventionally copy the ID token into.
|
|
38
|
+
cookies: ['__session'],
|
|
39
|
+
sharesAtlasCookie: true,
|
|
40
|
+
bearer: true,
|
|
41
|
+
notes: 'Identity Platform tenants sign with the same issuer (the tenant is the firebase.tenant claim); export each tenant into its own organization. Browser sessions (IndexedDB) are exchanged with readFirebaseBrowserSession from @atlasauth/js.',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'firebase_session_cookie',
|
|
45
|
+
label: 'Firebase session cookies (Admin SDK createSessionCookie)',
|
|
46
|
+
mode: 'jwt',
|
|
47
|
+
vars: { project_id: 'Firebase / Google Cloud project id' },
|
|
48
|
+
defaults: { cookie_name: 'session' },
|
|
49
|
+
jwt: {
|
|
50
|
+
issuer: 'https://session.firebase.google.com/{project_id}',
|
|
51
|
+
keysUrl: 'https://www.googleapis.com/identitytoolkit/v3/relyingparty/publicKeys',
|
|
52
|
+
keysFormat: 'x509',
|
|
53
|
+
audience: ['{project_id}'],
|
|
54
|
+
algorithms: ['RS256'],
|
|
55
|
+
claims: { subject: 'sub', email: 'email', emailVerified: 'email_verified', name: 'name' },
|
|
56
|
+
},
|
|
57
|
+
cookies: ['{cookie_name}', '__session'],
|
|
58
|
+
sharesAtlasCookie: true,
|
|
59
|
+
notes: 'Session cookies live up to two weeks and verify against the x509 key map; set cookie_name when your app named it something else.',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 'supabase',
|
|
63
|
+
label: 'Supabase Auth (hosted)',
|
|
64
|
+
mode: 'jwt',
|
|
65
|
+
vars: { project_ref: 'Project ref (the subdomain of <ref>.supabase.co)' },
|
|
66
|
+
jwt: {
|
|
67
|
+
issuer: 'https://{project_ref}.supabase.co/auth/v1',
|
|
68
|
+
keysUrl: 'https://{project_ref}.supabase.co/auth/v1/.well-known/jwks.json',
|
|
69
|
+
audience: ['authenticated'],
|
|
70
|
+
// ES256/RS256 with the new signing keys; HS256 with the legacy JWT secret (stored in the bridge settings).
|
|
71
|
+
algorithms: ['ES256', 'RS256', 'HS256'],
|
|
72
|
+
// `amr` is a list of { method, timestamp } objects and `aal` a level, so
|
|
73
|
+
// the second factor is not mapped: Atlas applies its own MFA policy.
|
|
74
|
+
claims: { subject: 'sub', email: 'email', sessionKey: 'session_id' },
|
|
75
|
+
expiredGraceSeconds: WEEK,
|
|
76
|
+
allowSharedSecret: true,
|
|
77
|
+
},
|
|
78
|
+
cookies: ['sb-{project_ref}-auth-token'],
|
|
79
|
+
tokenFormat: 'supabase',
|
|
80
|
+
clearCookies: ['sb-{project_ref}-auth-token', 'sb-{project_ref}-auth-token.*', 'sb-{project_ref}-auth-token-code-verifier'],
|
|
81
|
+
bearer: true,
|
|
82
|
+
notes: 'Anonymous users (is_anonymous) are refused like any user the import did not create.',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: 'supabase_refresh_token',
|
|
86
|
+
label: 'Supabase Auth (refresh tokens from a dump)',
|
|
87
|
+
mode: 'session_table',
|
|
88
|
+
vars: { project_ref: 'Project ref (the subdomain of <ref>.supabase.co)' },
|
|
89
|
+
// The export keys each live auth.refresh_tokens row by sha256(token): the
|
|
90
|
+
// refresh token in the SSR cookie finds it however long the user was away
|
|
91
|
+
// (the supabase JWT preset covers access tokens up to a week past expiry).
|
|
92
|
+
cookies: ['sb-{project_ref}-auth-token'],
|
|
93
|
+
tokenFormat: 'supabase_refresh',
|
|
94
|
+
clearCookies: ['sb-{project_ref}-auth-token', 'sb-{project_ref}-auth-token.*', 'sb-{project_ref}-auth-token-code-verifier'],
|
|
95
|
+
notes: 'Needs a dump of auth.refresh_tokens taken close to cutover. Refresh tokens Supabase issued after the dump are not known: keep the supabase preset for those, or re-import.',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'supabase_self_hosted',
|
|
99
|
+
label: 'Supabase Auth (self-hosted or custom domain)',
|
|
100
|
+
mode: 'jwt',
|
|
101
|
+
vars: { auth_url: 'The Auth URL (https://db.example.com/auth/v1)', cookie_name: 'The SSR cookie name (sb-<first label of the host>-auth-token)' },
|
|
102
|
+
jwt: {
|
|
103
|
+
issuer: '{auth_url}',
|
|
104
|
+
keysUrl: '{auth_url}/.well-known/jwks.json',
|
|
105
|
+
audience: ['authenticated'],
|
|
106
|
+
algorithms: ['ES256', 'RS256', 'HS256'],
|
|
107
|
+
claims: { subject: 'sub', email: 'email', sessionKey: 'session_id' },
|
|
108
|
+
expiredGraceSeconds: WEEK,
|
|
109
|
+
allowSharedSecret: true,
|
|
110
|
+
},
|
|
111
|
+
cookies: ['{cookie_name}'],
|
|
112
|
+
tokenFormat: 'supabase',
|
|
113
|
+
clearCookies: ['{cookie_name}', '{cookie_name}.*'],
|
|
114
|
+
bearer: true,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: 'cognito',
|
|
118
|
+
label: 'Amazon Cognito (ID tokens)',
|
|
119
|
+
mode: 'jwt',
|
|
120
|
+
vars: { region: 'AWS region (us-east-1)', user_pool_id: 'User pool id (us-east-1_AbCdEf)', client_id: 'App client id' },
|
|
121
|
+
jwt: {
|
|
122
|
+
issuer: 'https://cognito-idp.{region}.amazonaws.com/{user_pool_id}',
|
|
123
|
+
keysUrl: 'https://cognito-idp.{region}.amazonaws.com/{user_pool_id}/.well-known/jwks.json',
|
|
124
|
+
// ID tokens carry aud = the app client id (access tokens carry client_id and no aud).
|
|
125
|
+
audience: ['{client_id}'],
|
|
126
|
+
algorithms: ['RS256'],
|
|
127
|
+
claims: { subject: 'sub', email: 'email', emailVerified: 'email_verified', name: 'name', sessionKey: 'origin_jti' },
|
|
128
|
+
// ID tokens live an hour by default; Amplify refreshed them.
|
|
129
|
+
expiredGraceSeconds: WEEK,
|
|
130
|
+
},
|
|
131
|
+
// @aws-amplify/adapter-nextjs keeps the tokens in cookies named like Amplify's localStorage keys.
|
|
132
|
+
cookies: ['CognitoIdentityServiceProvider.{client_id}.*.idToken'],
|
|
133
|
+
clearCookies: ['CognitoIdentityServiceProvider.{client_id}.*'],
|
|
134
|
+
bearer: true,
|
|
135
|
+
notes: 'Users are matched on sub (the export keys users by sub). SPA sessions in localStorage are exchanged with readAmplifyBrowserSession from @atlasauth/js.',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: 'azure_ad_b2c',
|
|
139
|
+
label: 'Azure AD B2C (ID tokens)',
|
|
140
|
+
mode: 'jwt',
|
|
141
|
+
vars: {
|
|
142
|
+
tenant: 'Tenant name (contoso for contoso.b2clogin.com)',
|
|
143
|
+
tenant_id: 'Directory (tenant) id GUID',
|
|
144
|
+
policy: 'The user flow / custom policy that issued the tokens (B2C_1_signupsignin)',
|
|
145
|
+
client_id: 'Application (client) id',
|
|
146
|
+
},
|
|
147
|
+
jwt: {
|
|
148
|
+
issuer: 'https://{tenant}.b2clogin.com/{tenant_id}/v2.0/',
|
|
149
|
+
keysUrl: 'https://{tenant}.b2clogin.com/{tenant}.onmicrosoft.com/{policy}/discovery/v2.0/keys',
|
|
150
|
+
audience: ['{client_id}'],
|
|
151
|
+
algorithms: ['RS256'],
|
|
152
|
+
// B2C's sub is the user's object id by default, which the Graph export uses as the user id.
|
|
153
|
+
claims: { subject: 'sub', name: 'name' },
|
|
154
|
+
expiredGraceSeconds: WEEK,
|
|
155
|
+
},
|
|
156
|
+
cookies: [],
|
|
157
|
+
bearer: true,
|
|
158
|
+
notes: 'Keys are published per policy: run one bridge per user flow that issued tokens. MSAL keeps tokens in browser storage (encrypted from msal-browser v4): exchange v2/v3 caches with readMsalBrowserSession from @atlasauth/js; v4 apps rely on lazy migration.',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: 'entra_external_id',
|
|
162
|
+
label: 'Microsoft Entra External ID (ID tokens)',
|
|
163
|
+
mode: 'jwt',
|
|
164
|
+
vars: {
|
|
165
|
+
tenant: 'Tenant subdomain (contoso for contoso.ciamlogin.com)',
|
|
166
|
+
tenant_id: 'Directory (tenant) id GUID',
|
|
167
|
+
client_id: 'Application (client) id',
|
|
168
|
+
},
|
|
169
|
+
jwt: {
|
|
170
|
+
issuer: 'https://{tenant_id}.ciamlogin.com/{tenant_id}/v2.0',
|
|
171
|
+
keysUrl: 'https://{tenant}.ciamlogin.com/{tenant_id}/discovery/v2.0/keys',
|
|
172
|
+
audience: ['{client_id}'],
|
|
173
|
+
algorithms: ['RS256'],
|
|
174
|
+
// `sub` differs per application; `oid` is the directory object id the Graph export keys users by.
|
|
175
|
+
claims: { subject: 'oid', email: 'email', name: 'name', sessionKey: 'uti' },
|
|
176
|
+
expiredGraceSeconds: WEEK,
|
|
177
|
+
},
|
|
178
|
+
cookies: [],
|
|
179
|
+
bearer: true,
|
|
180
|
+
notes: 'MSAL keeps tokens in browser storage (encrypted from msal-browser v4): exchange v2/v3 caches with readMsalBrowserSession from @atlasauth/js.',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
id: 'appwrite',
|
|
184
|
+
label: 'Appwrite (session cookie, checked with Appwrite)',
|
|
185
|
+
mode: 'remote',
|
|
186
|
+
vars: { endpoint_url: 'API endpoint including /v1 (https://cloud.appwrite.io/v1, or your own)', project_id: 'Project id' },
|
|
187
|
+
// Appwrite keeps only a hash of each session secret, so sessions cannot be
|
|
188
|
+
// exported or verified offline: Atlas asks Appwrite who the session is. The
|
|
189
|
+
// cookie value (base64 of {id, secret}) is what X-Appwrite-Session takes.
|
|
190
|
+
remote: {
|
|
191
|
+
url: '{endpoint_url}/account',
|
|
192
|
+
method: 'GET',
|
|
193
|
+
headers: { 'x-appwrite-project': '{project_id}', 'x-appwrite-session': '{token}' },
|
|
194
|
+
subjectPath: '$id',
|
|
195
|
+
emailPath: 'email',
|
|
196
|
+
emailVerifiedPath: 'emailVerification',
|
|
197
|
+
namePath: 'name',
|
|
198
|
+
},
|
|
199
|
+
// a_session_<project id, lowercased> and its _legacy twin.
|
|
200
|
+
cookies: ['a_session_*'],
|
|
201
|
+
notes: 'The browser must send the Appwrite cookie to your app, so this works when Appwrite is on a subdomain of your app (custom domain) or your app does SSR with the session secret in its own cookie (pass its name as cookieNames). Client-only apps keep the session in localStorage (cookieFallback): exchange it with readAppwriteBrowserSession from @atlasauth/js. Keep the Appwrite project running for the bridge window.',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: 'pocketbase',
|
|
205
|
+
label: 'PocketBase (auth token, checked with PocketBase)',
|
|
206
|
+
mode: 'remote',
|
|
207
|
+
vars: { url: 'PocketBase URL (https://pb.example.com)' },
|
|
208
|
+
defaults: { collection: 'users' },
|
|
209
|
+
// Tokens are signed with a per-user tokenKey plus a per-collection secret, so
|
|
210
|
+
// nothing outside PocketBase can verify one: auth-refresh vouches for it.
|
|
211
|
+
remote: {
|
|
212
|
+
url: '{url}/api/collections/{collection}/auth-refresh',
|
|
213
|
+
method: 'POST',
|
|
214
|
+
headers: { authorization: '{token}' },
|
|
215
|
+
subjectPath: 'record.id',
|
|
216
|
+
emailPath: 'record.email',
|
|
217
|
+
emailVerifiedPath: 'record.verified',
|
|
218
|
+
namePath: 'record.name',
|
|
219
|
+
},
|
|
220
|
+
// pb_auth is the cookie the JS SDK's authStore.exportToCookie() writes (JSON with the token).
|
|
221
|
+
cookies: ['pb_auth'],
|
|
222
|
+
tokenFormat: 'pocketbase',
|
|
223
|
+
notes: 'Client-only apps keep the token in localStorage (pocketbase_auth): exchange it with readPocketBaseBrowserSession from @atlasauth/js. Keep PocketBase running for the bridge window.',
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
id: 'nhost',
|
|
227
|
+
label: 'Nhost (refresh tokens)',
|
|
228
|
+
mode: 'session_table',
|
|
229
|
+
// The export stores sha256(refresh token) — exactly what auth.refresh_tokens keeps.
|
|
230
|
+
cookies: ['nhostRefreshToken'],
|
|
231
|
+
clearCookies: ['nhostRefreshToken', 'nhostRefreshTokenExpiresAt', 'nhostSession'],
|
|
232
|
+
notes: 'SPA sessions keep the refresh token in localStorage (nhostRefreshToken): exchange them with readNhostBrowserSession from @atlasauth/js.',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
id: 'nhost_jwt',
|
|
236
|
+
label: 'Nhost (access tokens)',
|
|
237
|
+
mode: 'jwt',
|
|
238
|
+
vars: { auth_url: 'The Auth URL (https://<subdomain>.auth.<region>.nhost.run/v1)' },
|
|
239
|
+
// Legacy Hasura Auth signs with iss "hasura-auth"; current versions use the server URL.
|
|
240
|
+
defaults: { issuer: 'hasura-auth' },
|
|
241
|
+
jwt: {
|
|
242
|
+
issuer: '{issuer}',
|
|
243
|
+
keysUrl: '{auth_url}/.well-known/jwks.json',
|
|
244
|
+
algorithms: ['RS256', 'HS256', 'HS512'],
|
|
245
|
+
claims: { subject: 'sub', sessionKey: 'jti' },
|
|
246
|
+
expiredGraceSeconds: WEEK,
|
|
247
|
+
// Most projects sign with the shared HASURA_GRAPHQL_JWT_SECRET key.
|
|
248
|
+
allowSharedSecret: true,
|
|
249
|
+
},
|
|
250
|
+
cookies: [],
|
|
251
|
+
bearer: true,
|
|
252
|
+
},
|
|
253
|
+
];
|
|
254
|
+
//# sourceMappingURL=migration-presets-g3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-presets-g3.js","sourceRoot":"","sources":["../src/migration-presets-g3.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;GAYG;AAEH,6GAA6G;AAC7G,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAEd,QAAA,iBAAiB,GAAqC;IACjE;QACE,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,yDAAyD;QAChE,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,EAAE,UAAU,EAAE,oCAAoC,EAAE;QAC1D,GAAG,EAAE;YACH,MAAM,EAAE,6CAA6C;YACrD,OAAO,EAAE,2FAA2F;YACpG,QAAQ,EAAE,CAAC,cAAc,CAAC;YAC1B,UAAU,EAAE,CAAC,OAAO,CAAC;YACrB,0EAA0E;YAC1E,qDAAqD;YACrD,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE;YACzF,6FAA6F;YAC7F,mBAAmB,EAAE,IAAI;SAC1B;QACD,8EAA8E;QAC9E,0DAA0D;QAC1D,OAAO,EAAE,CAAC,WAAW,CAAC;QACtB,iBAAiB,EAAE,IAAI;QACvB,MAAM,EAAE,IAAI;QACZ,KAAK,EACH,6OAA6O;KAChP;IACD;QACE,EAAE,EAAE,yBAAyB;QAC7B,KAAK,EAAE,0DAA0D;QACjE,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,EAAE,UAAU,EAAE,oCAAoC,EAAE;QAC1D,QAAQ,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE;QACpC,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;KAC7L;IACD;QACE,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,wBAAwB;QAC/B,IAAI,EAAE,eAAe;QACrB,oFAAoF;QACpF,OAAO,EAAE,CAAC,mBAAmB,CAAC;QAC9B,YAAY,EAAE,CAAC,mBAAmB,EAAE,4BAA4B,EAAE,cAAc,CAAC;QACjF,KAAK,EAAE,yIAAyI;KACjJ;IACD;QACE,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,uBAAuB;QAC9B,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,EAAE,QAAQ,EAAE,+DAA+D,EAAE;QACnF,wFAAwF;QACxF,QAAQ,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE;QACnC,GAAG,EAAE;YACH,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,kCAAkC;YAC3C,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;YACvC,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;YAC7C,mBAAmB,EAAE,IAAI;YACzB,oEAAoE;YACpE,iBAAiB,EAAE,IAAI;SACxB;QACD,OAAO,EAAE,EAAE;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MigrationBridgePreset } from '../migration-presets';
|
|
2
|
+
/**
|
|
3
|
+
* authentik. An application's OAuth2/OpenID provider signs its ID and access
|
|
4
|
+
* tokens with the signing key chosen on the provider (RS256 / ES256). The
|
|
5
|
+
* issuer is per provider and ends in a slash — `iss` is compared as a string,
|
|
6
|
+
* so the template restores the slash the variable resolver trims:
|
|
7
|
+
* https://auth.example.com/application/o/<application slug>/
|
|
8
|
+
* with the keys at `<issuer>jwks/`.
|
|
9
|
+
*
|
|
10
|
+
* `sub` depends on the provider's "Subject mode" (hashed user id by default);
|
|
11
|
+
* the export keys users by the same mode, so the two agree. `sid` is authentik's
|
|
12
|
+
* session id (a hash), shared by every token of one sign-in.
|
|
13
|
+
*/
|
|
14
|
+
export declare const AUTHENTIK_BRIDGE_PRESETS: readonly MigrationBridgePreset[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AUTHENTIK_BRIDGE_PRESETS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* authentik. An application's OAuth2/OpenID provider signs its ID and access
|
|
6
|
+
* tokens with the signing key chosen on the provider (RS256 / ES256). The
|
|
7
|
+
* issuer is per provider and ends in a slash — `iss` is compared as a string,
|
|
8
|
+
* so the template restores the slash the variable resolver trims:
|
|
9
|
+
* https://auth.example.com/application/o/<application slug>/
|
|
10
|
+
* with the keys at `<issuer>jwks/`.
|
|
11
|
+
*
|
|
12
|
+
* `sub` depends on the provider's "Subject mode" (hashed user id by default);
|
|
13
|
+
* the export keys users by the same mode, so the two agree. `sid` is authentik's
|
|
14
|
+
* session id (a hash), shared by every token of one sign-in.
|
|
15
|
+
*/
|
|
16
|
+
exports.AUTHENTIK_BRIDGE_PRESETS = [
|
|
17
|
+
{
|
|
18
|
+
id: 'authentik',
|
|
19
|
+
label: 'authentik (OAuth2 / OpenID provider tokens)',
|
|
20
|
+
mode: 'jwt',
|
|
21
|
+
vars: { issuer: "The provider's issuer URL without the trailing slash (https://auth.example.com/application/o/<application slug>)", client_id: "The provider's client id (the tokens' aud)" },
|
|
22
|
+
jwt: {
|
|
23
|
+
issuer: '{issuer}/',
|
|
24
|
+
keysUrl: '{issuer}/jwks/',
|
|
25
|
+
audience: ['{client_id}'],
|
|
26
|
+
// A provider without a signing key signs HS256 with its client secret: no public keys exist for it.
|
|
27
|
+
algorithms: ['RS256', 'RS384', 'RS512', 'PS256', 'ES256', 'ES384'],
|
|
28
|
+
claims: { subject: 'sub', email: 'email', emailVerified: 'email_verified', name: 'name', sessionKey: 'sid', mfa: 'amr:mfa' },
|
|
29
|
+
},
|
|
30
|
+
// authentik is the identity provider, not the app: the app's own OIDC client library keeps the token
|
|
31
|
+
// (next-auth, passport-openidconnect, oauth2-proxy). Pass it as a bearer token or from your own extractor.
|
|
32
|
+
cookies: [],
|
|
33
|
+
bearer: true,
|
|
34
|
+
notes: 'Set the provider\'s Subject mode to the one the export used (hashed user id by default; the export records it). The provider needs a signing key: tokens signed with the client secret (HS256) cannot be verified from public keys. With the "global" issuer mode, point the preset at the per-provider URL anyway: the keys are served there.',
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
//# sourceMappingURL=authentik.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentik.js","sourceRoot":"","sources":["../../src/migration-presets-g4/authentik.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AACU,QAAA,wBAAwB,GAAqC;IACxE;QACE,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,6CAA6C;QACpD,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,EAAE,MAAM,EAAE,kHAAkH,EAAE,SAAS,EAAE,4CAA4C,EAAE;QAC7L,GAAG,EAAE;YACH,MAAM,EAAE,WAAW;YACnB,OAAO,EAAE,gBAAgB;YACzB,QAAQ,EAAE,CAAC,aAAa,CAAC;YACzB,oGAAoG;YACpG,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;YAClE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE;SAC7H;QACD,qGAAqG;QACrG,2GAA2G;QAC3G,OAAO,EAAE,EAAE;QACX,MAAM,EAAE,IAAI;QACZ,KAAK,EACH,gVAAgV;KACnV;CACF,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FUSIONAUTH_BRIDGE_PRESETS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* FusionAuth. The access token (`app.at` cookie, or the Bearer token an API
|
|
6
|
+
* client holds) is a JWT whose `iss` is the TENANT's issuer string: `acme.com`
|
|
7
|
+
* by default (what `issuer_name` takes), or an https URL when the tenant was
|
|
8
|
+
* set up that way (the `fusionauth_url_issuer` preset takes the base URL).
|
|
9
|
+
* Keys come from `/.well-known/jwks.json` and publish only asymmetric keys:
|
|
10
|
+
* a tenant still on the default HS256 signing key has to switch the
|
|
11
|
+
* application's access-token key to an RSA or EC key before the bridge can
|
|
12
|
+
* verify its tokens. `sub` is the FusionAuth user id the export keys users by,
|
|
13
|
+
* `sid` the SSO session, `amr` lists `mfa` after a second factor.
|
|
14
|
+
*/
|
|
15
|
+
const WEEK = 7 * 24 * 3600;
|
|
16
|
+
const CLAIMS = { subject: 'sub', email: 'email', emailVerified: 'email_verified', name: 'name', sessionKey: 'sid', mfa: 'amr:mfa' };
|
|
17
|
+
exports.FUSIONAUTH_BRIDGE_PRESETS = [
|
|
18
|
+
{
|
|
19
|
+
id: 'fusionauth',
|
|
20
|
+
label: 'FusionAuth (access token, tenant issuer such as acme.com)',
|
|
21
|
+
mode: 'jwt',
|
|
22
|
+
vars: { base_url: 'FusionAuth URL (https://auth.example.com)', issuer_name: 'The tenant issuer (Tenants → General → Issuer, `acme.com` by default)' },
|
|
23
|
+
jwt: {
|
|
24
|
+
issuer: '{issuer_name}',
|
|
25
|
+
keysUrl: '{base_url}/.well-known/jwks.json',
|
|
26
|
+
algorithms: ['RS256', 'RS384', 'RS512', 'ES256', 'ES384', 'ES512'],
|
|
27
|
+
claims: CLAIMS,
|
|
28
|
+
expiredGraceSeconds: WEEK,
|
|
29
|
+
},
|
|
30
|
+
cookies: ['app.at'],
|
|
31
|
+
clearCookies: ['app.at', 'app.rt', 'app.idt', 'app.match_hint', 'app.locale', 'app.ssoToken'],
|
|
32
|
+
bearer: true,
|
|
33
|
+
notes: 'The application must sign access tokens with an RSA or EC key (a default HS256 key has no public JWKS entry).',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'fusionauth_url_issuer',
|
|
37
|
+
label: 'FusionAuth (access token, tenant issuer is the https URL)',
|
|
38
|
+
mode: 'jwt',
|
|
39
|
+
vars: { base_url: 'FusionAuth URL, also the tenant issuer (https://auth.example.com)' },
|
|
40
|
+
jwt: {
|
|
41
|
+
issuer: '{base_url}',
|
|
42
|
+
keysUrl: '{base_url}/.well-known/jwks.json',
|
|
43
|
+
algorithms: ['RS256', 'RS384', 'RS512', 'ES256', 'ES384', 'ES512'],
|
|
44
|
+
claims: CLAIMS,
|
|
45
|
+
expiredGraceSeconds: WEEK,
|
|
46
|
+
},
|
|
47
|
+
cookies: ['app.at'],
|
|
48
|
+
clearCookies: ['app.at', 'app.rt', 'app.idt', 'app.match_hint', 'app.locale', 'app.ssoToken'],
|
|
49
|
+
bearer: true,
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
//# sourceMappingURL=fusionauth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fusionauth.js","sourceRoot":"","sources":["../../src/migration-presets-g4/fusionauth.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;GAUG;AACH,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAC3B,MAAM,MAAM,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC;AAEvH,QAAA,yBAAyB,GAAqC;IACzE;QACE,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,2DAA2D;QAClE,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,EAAE,QAAQ,EAAE,2CAA2C,EAAE,WAAW,EAAE,uEAAuE,EAAE;QACrJ,GAAG,EAAE;YACH,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,kCAAkC;YAC3C,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;YAClE,MAAM,EAAE,MAAM;YACd,mBAAmB,EAAE,IAAI;SAC1B;QACD,OAAO,EAAE,CAAC,QAAQ,CAAC;QACnB,YAAY,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,cAAc,CAAC;QAC7F,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,+GAA+G;KACvH;IACD;QACE,EAAE,EAAE,uBAAuB;QAC3B,KAAK,EAAE,2DAA2D;QAClE,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,EAAE,QAAQ,EAAE,mEAAmE,EAAE;QACvF,GAAG,EAAE;YACH,MAAM,EAAE,YAAY;YACpB,OAAO,EAAE,kCAAkC;YAC3C,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;YAClE,MAAM,EAAE,MAAM;YACd,mBAAmB,EAAE,IAAI;SAC1B;QACD,OAAO,EAAE,CAAC,QAAQ,CAAC;QACnB,YAAY,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,cAAc,CAAC;QAC7F,MAAM,EAAE,IAAI;KACb;CACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MigrationBridgePreset } from '../migration-presets';
|
|
2
|
+
/**
|
|
3
|
+
* Hanko. The backend signs a session JWT (RS256, a rotating key set at
|
|
4
|
+
* `/.well-known/jwks.json` on the public API) and writes it to the `hanko`
|
|
5
|
+
* cookie (`cookie.name`); the frontend SDK and hanko-elements read the same
|
|
6
|
+
* token. Claims: `sub` (the user's id — what the export keys users by),
|
|
7
|
+
* `session_id`, `exp`, `iat`, `aud`, `iss` (when `session.issuer` is set) and
|
|
8
|
+
* `email` / `username`. `email` is an object (`address`, `is_primary`,
|
|
9
|
+
* `is_verified`), so it is not mapped to a claim; the imported user already
|
|
10
|
+
* holds the addresses.
|
|
11
|
+
*/
|
|
12
|
+
export declare const HANKO_BRIDGE_PRESETS: readonly MigrationBridgePreset[];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HANKO_BRIDGE_PRESETS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Hanko. The backend signs a session JWT (RS256, a rotating key set at
|
|
6
|
+
* `/.well-known/jwks.json` on the public API) and writes it to the `hanko`
|
|
7
|
+
* cookie (`cookie.name`); the frontend SDK and hanko-elements read the same
|
|
8
|
+
* token. Claims: `sub` (the user's id — what the export keys users by),
|
|
9
|
+
* `session_id`, `exp`, `iat`, `aud`, `iss` (when `session.issuer` is set) and
|
|
10
|
+
* `email` / `username`. `email` is an object (`address`, `is_primary`,
|
|
11
|
+
* `is_verified`), so it is not mapped to a claim; the imported user already
|
|
12
|
+
* holds the addresses.
|
|
13
|
+
*/
|
|
14
|
+
exports.HANKO_BRIDGE_PRESETS = [
|
|
15
|
+
{
|
|
16
|
+
id: 'hanko',
|
|
17
|
+
label: 'Hanko (session JWT, issuer = the API URL)',
|
|
18
|
+
mode: 'jwt',
|
|
19
|
+
vars: { base_url: 'The Hanko API URL (https://<project id>.hanko.io, or your own https://hanko.example.com)' },
|
|
20
|
+
jwt: {
|
|
21
|
+
issuer: '{base_url}',
|
|
22
|
+
keysUrl: '{base_url}/.well-known/jwks.json',
|
|
23
|
+
algorithms: ['RS256', 'RS384', 'RS512', 'PS256', 'ES256'],
|
|
24
|
+
claims: { subject: 'sub', sessionKey: 'session_id' },
|
|
25
|
+
},
|
|
26
|
+
cookies: ['hanko'],
|
|
27
|
+
bearer: true,
|
|
28
|
+
sharesAtlasCookie: false,
|
|
29
|
+
notes: 'Hanko Cloud sets iss to the project URL. Self-hosted: use hanko_jwt when session.issuer is something else. The cookie is named by cookie.name in Hanko\'s config (default hanko).',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'hanko_jwt',
|
|
33
|
+
label: 'Hanko (session JWT, custom issuer)',
|
|
34
|
+
mode: 'jwt',
|
|
35
|
+
vars: { base_url: 'The Hanko API URL (keys are read from /.well-known/jwks.json)', issuer: "The session.issuer you configured (the token's iss)" },
|
|
36
|
+
jwt: {
|
|
37
|
+
issuer: '{issuer}',
|
|
38
|
+
keysUrl: '{base_url}/.well-known/jwks.json',
|
|
39
|
+
algorithms: ['RS256', 'RS384', 'RS512', 'PS256', 'ES256'],
|
|
40
|
+
claims: { subject: 'sub', sessionKey: 'session_id' },
|
|
41
|
+
},
|
|
42
|
+
cookies: ['hanko'],
|
|
43
|
+
bearer: true,
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
//# sourceMappingURL=hanko.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hanko.js","sourceRoot":"","sources":["../../src/migration-presets-g4/hanko.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;GASG;AACU,QAAA,oBAAoB,GAAqC;IACpE;QACE,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,2CAA2C;QAClD,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,EAAE,QAAQ,EAAE,0FAA0F,EAAE;QAC9G,GAAG,EAAE;YACH,MAAM,EAAE,YAAY;YACpB,OAAO,EAAE,kCAAkC;YAC3C,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;YACzD,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE;SACrD;QACD,OAAO,EAAE,CAAC,OAAO,CAAC;QAClB,MAAM,EAAE,IAAI;QACZ,iBAAiB,EAAE,KAAK;QACxB,KAAK,EACH,mLAAmL;KACtL;IACD;QACE,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,oCAAoC;QAC3C,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,EAAE,QAAQ,EAAE,+DAA+D,EAAE,MAAM,EAAE,qDAAqD,EAAE;QAClJ,GAAG,EAAE;YACH,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,kCAAkC;YAC3C,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;YACzD,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE;SACrD;QACD,OAAO,EAAE,CAAC,OAAO,CAAC;QAClB,MAAM,EAAE,IAAI;KACb;CACF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { MigrationBridgePreset } from '../migration-presets';
|
|
2
|
+
/**
|
|
3
|
+
* Keycloak. Its browser adapter (keycloak-js) keeps the access / ID / refresh
|
|
4
|
+
* tokens in memory, and server adapters (keycloak-connect, NextAuth's Keycloak
|
|
5
|
+
* provider) keep them server-side or inside an encrypted cookie, so the token
|
|
6
|
+
* an integrator can hand the bridge is the access or ID token itself (Bearer
|
|
7
|
+
* header or the `exchangeMigrationBrowserSession` browser helper). The
|
|
8
|
+
* `KEYCLOAK_IDENTITY` cookie is signed with the realm's own HMAC secret and is
|
|
9
|
+
* never accepted.
|
|
10
|
+
*
|
|
11
|
+
* Access tokens live five minutes by default and nobody refreshes them after
|
|
12
|
+
* the switch, so a validly signed token is accepted (once) for a week past `exp`.
|
|
13
|
+
* Keycloak 16 and older serve under `/auth`: pass `base_url` as
|
|
14
|
+
* `https://sso.example.com/auth`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const KEYCLOAK_BRIDGE_PRESETS: readonly MigrationBridgePreset[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KEYCLOAK_BRIDGE_PRESETS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Keycloak. Its browser adapter (keycloak-js) keeps the access / ID / refresh
|
|
6
|
+
* tokens in memory, and server adapters (keycloak-connect, NextAuth's Keycloak
|
|
7
|
+
* provider) keep them server-side or inside an encrypted cookie, so the token
|
|
8
|
+
* an integrator can hand the bridge is the access or ID token itself (Bearer
|
|
9
|
+
* header or the `exchangeMigrationBrowserSession` browser helper). The
|
|
10
|
+
* `KEYCLOAK_IDENTITY` cookie is signed with the realm's own HMAC secret and is
|
|
11
|
+
* never accepted.
|
|
12
|
+
*
|
|
13
|
+
* Access tokens live five minutes by default and nobody refreshes them after
|
|
14
|
+
* the switch, so a validly signed token is accepted (once) for a week past `exp`.
|
|
15
|
+
* Keycloak 16 and older serve under `/auth`: pass `base_url` as
|
|
16
|
+
* `https://sso.example.com/auth`.
|
|
17
|
+
*/
|
|
18
|
+
exports.KEYCLOAK_BRIDGE_PRESETS = [
|
|
19
|
+
{
|
|
20
|
+
id: 'keycloak',
|
|
21
|
+
label: 'Keycloak (access or ID token)',
|
|
22
|
+
mode: 'jwt',
|
|
23
|
+
vars: { base_url: 'Keycloak base URL (https://sso.example.com; add /auth for Keycloak 16 and older)', realm: 'Realm name' },
|
|
24
|
+
jwt: {
|
|
25
|
+
issuer: '{base_url}/realms/{realm}',
|
|
26
|
+
keysUrl: '{base_url}/realms/{realm}/protocol/openid-connect/certs',
|
|
27
|
+
algorithms: ['RS256', 'RS384', 'RS512', 'PS256', 'ES256', 'ES384'],
|
|
28
|
+
// sub = the Keycloak user id (what the realm export keys users by); sid = the SSO session id.
|
|
29
|
+
claims: { subject: 'sub', email: 'email', emailVerified: 'email_verified', name: 'name', sessionKey: 'sid', mfa: 'acr:2' },
|
|
30
|
+
expiredGraceSeconds: 7 * 24 * 3600,
|
|
31
|
+
},
|
|
32
|
+
cookies: [],
|
|
33
|
+
bearer: true,
|
|
34
|
+
notes: 'Use the access token or the ID token (both carry sub, email, sid). Realm keys must publish a signing algorithm from the list (the default RS256 does; HS512 keys are never accepted). A step-up login raises the acr claim to 2 when you map levels of authentication to "2"; otherwise an MFA sign-in is not marked.',
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
//# sourceMappingURL=keycloak.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keycloak.js","sourceRoot":"","sources":["../../src/migration-presets-g4/keycloak.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;GAaG;AACU,QAAA,uBAAuB,GAAqC;IACvE;QACE,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,+BAA+B;QACtC,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,EAAE,QAAQ,EAAE,kFAAkF,EAAE,KAAK,EAAE,YAAY,EAAE;QAC3H,GAAG,EAAE;YACH,MAAM,EAAE,2BAA2B;YACnC,OAAO,EAAE,yDAAyD;YAClE,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;YAClE,8FAA8F;YAC9F,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE;YAC1H,mBAAmB,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI;SACnC;QACD,OAAO,EAAE,EAAE;QACX,MAAM,EAAE,IAAI;QACZ,KAAK,EACH,uTAAuT;KAC1T;CACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MigrationBridgePreset } from '../migration-presets';
|
|
2
|
+
/**
|
|
3
|
+
* Logto. The tenant's OIDC issuer is `{endpoint}/oidc` (`https://auth.example.com/oidc`,
|
|
4
|
+
* `https://abc123.logto.app/oidc` on Logto Cloud); its signing keys are at
|
|
5
|
+
* `/oidc/jwks` and default to ES384. The token to exchange is the application's
|
|
6
|
+
* ID token (`aud` = the Logto application id) — what `@logto/*` SDKs keep in
|
|
7
|
+
* the app's own session. The SDKs store that session encrypted with the app's
|
|
8
|
+
* cookie secret (or in the server's session store), so no cookie is named here:
|
|
9
|
+
* hand the middleware a token extractor that opens the session locally, or send
|
|
10
|
+
* the ID token as a bearer token from the client.
|
|
11
|
+
*/
|
|
12
|
+
export declare const LOGTO_BRIDGE_PRESETS: readonly MigrationBridgePreset[];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LOGTO_BRIDGE_PRESETS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Logto. The tenant's OIDC issuer is `{endpoint}/oidc` (`https://auth.example.com/oidc`,
|
|
6
|
+
* `https://abc123.logto.app/oidc` on Logto Cloud); its signing keys are at
|
|
7
|
+
* `/oidc/jwks` and default to ES384. The token to exchange is the application's
|
|
8
|
+
* ID token (`aud` = the Logto application id) — what `@logto/*` SDKs keep in
|
|
9
|
+
* the app's own session. The SDKs store that session encrypted with the app's
|
|
10
|
+
* cookie secret (or in the server's session store), so no cookie is named here:
|
|
11
|
+
* hand the middleware a token extractor that opens the session locally, or send
|
|
12
|
+
* the ID token as a bearer token from the client.
|
|
13
|
+
*/
|
|
14
|
+
exports.LOGTO_BRIDGE_PRESETS = [
|
|
15
|
+
{
|
|
16
|
+
id: 'logto',
|
|
17
|
+
label: 'Logto',
|
|
18
|
+
mode: 'jwt',
|
|
19
|
+
vars: {
|
|
20
|
+
base_url: 'Your Logto endpoint (https://auth.example.com or https://abc123.logto.app)',
|
|
21
|
+
client_id: 'The id of your Logto application (the audience of its ID tokens)',
|
|
22
|
+
},
|
|
23
|
+
jwt: {
|
|
24
|
+
issuer: '{base_url}/oidc',
|
|
25
|
+
keysUrl: '{base_url}/oidc/jwks',
|
|
26
|
+
audience: ['{client_id}'],
|
|
27
|
+
algorithms: ['ES384', 'ES256', 'RS256', 'PS256', 'EdDSA'],
|
|
28
|
+
claims: { subject: 'sub', email: 'email', emailVerified: 'email_verified', name: 'name', sessionKey: 'sid' },
|
|
29
|
+
},
|
|
30
|
+
cookies: [],
|
|
31
|
+
bearer: true,
|
|
32
|
+
notes: 'Exchange the ID token. Logto SDK sessions are encrypted with your cookie secret (or kept in your session store): pass the middleware a token extractor that reads the idToken from the session locally. API access tokens carry the API resource as their audience and are not accepted here.',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
//# sourceMappingURL=logto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logto.js","sourceRoot":"","sources":["../../src/migration-presets-g4/logto.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;GASG;AACU,QAAA,oBAAoB,GAAqC;IACpE;QACE,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,KAAK;QACX,IAAI,EAAE;YACJ,QAAQ,EAAE,4EAA4E;YACtF,SAAS,EAAE,kEAAkE;SAC9E;QACD,GAAG,EAAE;YACH,MAAM,EAAE,iBAAiB;YACzB,OAAO,EAAE,sBAAsB;YAC/B,QAAQ,EAAE,CAAC,aAAa,CAAC;YACzB,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;YACzD,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE;SAC7G;QACD,OAAO,EAAE,EAAE;QACX,MAAM,EAAE,IAAI;QACZ,KAAK,EACH,+RAA+R;KAClS;CACF,CAAC"}
|