@softistx/janus 0.73.1 → 0.75.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/README.md +22 -2
- package/dist/auth/config/index.d.ts +1 -1
- package/dist/auth/config/index.d.ts.map +1 -1
- package/dist/auth/config/resolve-social.d.ts.map +1 -1
- package/dist/auth/config/social-config.d.ts +31 -0
- package/dist/auth/config/social-config.d.ts.map +1 -1
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/passkeys/sign-in.d.ts +5 -2
- package/dist/auth/passkeys/sign-in.d.ts.map +1 -1
- package/dist/auth/port/memory/social-links.d.ts.map +1 -1
- package/dist/auth/port/types/social-links.d.ts +8 -0
- package/dist/auth/port/types/social-links.d.ts.map +1 -1
- package/dist/auth/sessions/amr.d.ts +1 -1
- package/dist/auth/shared-api.d.ts +3 -0
- package/dist/auth/shared-api.d.ts.map +1 -1
- package/dist/auth/social/complete.d.ts.map +1 -1
- package/dist/auth/social/federated-amr.d.ts +15 -0
- package/dist/auth/social/federated-amr.d.ts.map +1 -0
- package/dist/auth/social/find-provider.d.ts.map +1 -1
- package/dist/auth/social/finish.d.ts +2 -0
- package/dist/auth/social/finish.d.ts.map +1 -1
- package/dist/auth/social/index.d.ts.map +1 -1
- package/dist/auth/social/unlink.d.ts +7 -0
- package/dist/auth/social/unlink.d.ts.map +1 -1
- package/dist/auth/types/index.d.ts +1 -1
- package/dist/auth/types/index.d.ts.map +1 -1
- package/dist/auth/types/passkeys.d.ts +16 -1
- package/dist/auth/types/passkeys.d.ts.map +1 -1
- package/dist/auth/types/social.d.ts +8 -0
- package/dist/auth/types/social.d.ts.map +1 -1
- package/dist/chunks/{index-k6y18nx9.js → index-7h34nqrm.js} +10 -2
- package/dist/chunks/{index-k6y18nx9.js.map → index-7h34nqrm.js.map} +3 -3
- package/dist/conformance/cases/social-links/reads.d.ts.map +1 -1
- package/dist/conformance/index.js +33 -2
- package/dist/conformance/index.js.map +3 -3
- package/dist/index.js +121 -23
- package/dist/index.js.map +13 -12
- package/docs/guide/adapters.md +6 -3
- package/docs/guide/errors.md +1 -1
- package/docs/guide/passkeys.md +16 -1
- package/docs/guide/sessions.md +1 -1
- package/docs/guide/social.md +50 -0
- package/docs/roadmap.md +3 -0
- package/docs/troubleshooting.md +28 -0
- package/package.json +1 -1
package/docs/guide/adapters.md
CHANGED
|
@@ -31,7 +31,7 @@ describeJanusStores({
|
|
|
31
31
|
|
|
32
32
|
| Port | Taken by | Methods |
|
|
33
33
|
| --- | --- | --- |
|
|
34
|
-
| `JanusStores` — `{ users: UserStore, sessions: SessionStore, tokens: TokenStore, socialLinks?: SocialLinkStore, passkeys?: PasskeyStore }` | `janus({ store })` | 6 (+ 1 optional) + 7 (+ 1 optional) + 5 (+ 1 optional) + 5 (the optional `socialLinks` slot) + 7 (the optional `passkeys` slot) |
|
|
34
|
+
| `JanusStores` — `{ users: UserStore, sessions: SessionStore, tokens: TokenStore, socialLinks?: SocialLinkStore, passkeys?: PasskeyStore }` | `janus({ store })` | 6 (+ 1 optional) + 7 (+ 1 optional) + 5 (+ 1 optional) + 5 (+ 1 optional) (the optional `socialLinks` slot) + 7 (the optional `passkeys` slot) |
|
|
35
35
|
| `RelationStore` | `permissions({ store })`, `janus({ relations })` | 6 (+ 1 optional) |
|
|
36
36
|
|
|
37
37
|
They are separate on purpose: an application that only authenticates
|
|
@@ -516,7 +516,10 @@ pair**: its own when it wrote, the holder's when the pair was already linked
|
|
|
516
516
|
(then nothing is written; the core reads `userId` to learn it lost). Never a
|
|
517
517
|
read followed by a write: twenty concurrent inserts leave one record.
|
|
518
518
|
`findSocialLink` answers the record or `null`; `listUserSocialLinks` a list,
|
|
519
|
-
`[]` for none; `
|
|
519
|
+
`[]` for none; the **optional** `countSocialLinks(provider)` answers how many
|
|
520
|
+
links go through one provider in the store's partition (`0` for none; what
|
|
521
|
+
`auth.social.countLinks` calls, and a store without it makes that call throw `UNSUPPORTED`);
|
|
522
|
+
`deleteSocialLink(userId, provider, accountId)` is conditional on
|
|
520
523
|
the owner and answers whether it deleted; `deleteUserSocialLinks` answers a
|
|
521
524
|
count, and is what deleting a user calls. The suite's `socialLinks` cases and
|
|
522
525
|
five outage cases run when the harness opens stores with the slot.
|
|
@@ -711,7 +714,7 @@ compile error naming the missing method.
|
|
|
711
714
|
|
|
712
715
|
| Suite | Cases | Harness opens |
|
|
713
716
|
| --- | --- | --- |
|
|
714
|
-
| `describeJanusStores({ name, harness, runner?, faults?, skip? })` |
|
|
717
|
+
| `describeJanusStores({ name, harness, runner?, faults?, skip? })` | 100: users, sessions, tokens, the optional `socialLinks` and `passkeys` slots, and one outage per method whose honest answer can be "nothing" — twenty-nine of them | `{ stores, faults?, close? }` |
|
|
715
718
|
| `describeRelationStores({ name, harness, runner?, faults?, skip? })` | 16: the relation store, ids of edge characters, and one outage per method | `{ store, faults?, close? }` |
|
|
716
719
|
| `describeApiKeyStores({ name, harness, runner?, faults?, skip? })` | the optional `ApiKeyStore`: insert, list, the conditional touch, revoke, delete, and one outage per method; the `bound`, `userBound` and `expiryNotice` cases are skipped, with their reason, for a store without that capability | `{ store, faults?, close? }` |
|
|
717
720
|
| `describeInvitationStores({ name, harness, runner?, faults?, skip? })` | the optional `InvitationStore`: insert and the pending constraint, find by id and by code hash, list, count, the conditional update, delete, and one outage per method | `{ store, faults?, close? }` |
|
package/docs/guide/errors.md
CHANGED
|
@@ -70,7 +70,7 @@ that wired the library, so no handler needs to tell it apart.
|
|
|
70
70
|
| `SECOND_FACTOR_ACTIVE` | `SecondFactorError` | 409 | `enroll` or `activate` on a factor already active: `disable` it first | `userId` |
|
|
71
71
|
| `INVALID_CURSOR` | `InvalidCursorError` | 400 | A cursor this store did not mint. Never a silent first page | |
|
|
72
72
|
| `CURSOR_FILTER_MISMATCH` | `CursorFilterMismatchError` | 400 | `invitations.list({ after })` with a `nextCursor` issued for another scope, status, role, ref, lapsed or order. Never a page of the other list | |
|
|
73
|
-
| `UNSUPPORTED` | `UnsupportedError` | 501 | The wired store lacks an optional capability — `collectExpired` with neither `deleteExpiredSessions` nor `deleteExpiredTokens`,
|
|
73
|
+
| `UNSUPPORTED` | `UnsupportedError` | 501 | The wired store lacks an optional capability — `collectExpired` with neither `deleteExpiredSessions` nor `deleteExpiredTokens`, `sessions.list` / `sessions.revoke` without `listUserSessions`, or `social.countLinks` without `countSocialLinks` | `slot`, `operation` |
|
|
74
74
|
| `PERMISSION_DEPTH` | `PermissionDepthError` | 500 | A check or list walked past `maxDepth`. **Not a denial** | `permission`, `maxDepth` |
|
|
75
75
|
| `API_KEY_LIMIT` | `ApiKeyLimitError` | 409 | `apiKeys.create` for a user who already holds `maxActive` standing keys (refused before anything is written); the key a race inserted is revoked again. Revoke one, then create — see [API keys](api-keys.md#creating-a-key) | `maxActive`, `userId` |
|
|
76
76
|
| `API_KEY_INVALID` | `ApiKeyInvalidError` | 400 | `apiKeys.create` with a name empty, over 100 characters once trimmed, or holding a NUL or a lone surrogate, or a lifetime not among `apiKeys.lifetimes`, or `scopes` that are not 1 to 32 scope tokens, or a `bound` that is not `{ type, id }`. Nothing was written | `field`: `'name'`, `'lifetime'`, `'scopes'` or `'bound'` |
|
package/docs/guide/passkeys.md
CHANGED
|
@@ -273,6 +273,21 @@ const { options, challenge, expiresAt } = await auth.passkeys.signInOptions();
|
|
|
273
273
|
const { user, session, token } = await auth.passkeys.signIn(challenge, response, { device });
|
|
274
274
|
```
|
|
275
275
|
|
|
276
|
+
A policy that must refuse some users (an e-mail domain that signs in through
|
|
277
|
+
SSO) goes in `guard`, which runs once the assertion verified and before the
|
|
278
|
+
passkey's use is recorded or any session opens, so a refusal leaves no token
|
|
279
|
+
and no cookie to revoke:
|
|
280
|
+
|
|
281
|
+
```ts
|
|
282
|
+
await auth.passkeys.signIn(challenge, response, {
|
|
283
|
+
guard: (user) => {
|
|
284
|
+
if (String(user.email).endsWith('@acme-sso.example.com')) {
|
|
285
|
+
throw new Error('Use SSO'); // thrown as it is; nothing was opened
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
```
|
|
290
|
+
|
|
276
291
|
```ts
|
|
277
292
|
interface PasskeySignInChallenge {
|
|
278
293
|
options: Record<string, unknown>; // for navigator.credentials.get
|
|
@@ -280,7 +295,7 @@ interface PasskeySignInChallenge {
|
|
|
280
295
|
expiresAt: Date;
|
|
281
296
|
}
|
|
282
297
|
signInOptions(): Promise<PasskeySignInChallenge>;
|
|
283
|
-
signIn(challenge: string, response: unknown, options?:
|
|
298
|
+
signIn(challenge: string, response: unknown, options?: PasskeySignInOptions): Promise<SignedIn<User>>;
|
|
284
299
|
```
|
|
285
300
|
|
|
286
301
|
`signIn` answers like a password sign-in (`session.authenticatedAt` is now, the
|
package/docs/guide/sessions.md
CHANGED
|
@@ -479,7 +479,7 @@ the field existed reads `amr: []`.
|
|
|
479
479
|
| App code (TOTP) as second factor or step-up | `otp`, `mfa` |
|
|
480
480
|
| Recovery code as second factor | `otp`, `mfa` |
|
|
481
481
|
| Passkey as second factor or step-up | `hwk`, `user`, `mfa` |
|
|
482
|
-
| Social sign-in | `fed` |
|
|
482
|
+
| Social sign-in | `fed`, plus what the provider's `federatedAmr` grants ([social](social.md)) |
|
|
483
483
|
| `signInProven` | nothing: the proof is yours |
|
|
484
484
|
|
|
485
485
|
A second factor adds to its first factor's methods (`['pwd', 'otp', 'mfa']`),
|
package/docs/guide/social.md
CHANGED
|
@@ -145,6 +145,46 @@ it only when `result.stepUp !== null` (and, if it matters, that its `acr` or
|
|
|
145
145
|
Rolling deploys: an instance from before this version reading a six-part cookie
|
|
146
146
|
answers `FLOW_MISMATCH`; the visitor starts again.
|
|
147
147
|
|
|
148
|
+
## Recording the provider's proof in the session (`federatedAmr`)
|
|
149
|
+
|
|
150
|
+
A social sign-in records `fed` in `session.amr`. When the provider's ID token
|
|
151
|
+
also says how the user authenticated upstream (`acr: 'urn:example:mfa'`,
|
|
152
|
+
`amr: ['pwd', 'otp']`), a provider you trust can map those claims into the
|
|
153
|
+
session's methods, so step-up policies (`isMultiFactor`, an OAuth approval's
|
|
154
|
+
`amr`) see the federated proof:
|
|
155
|
+
|
|
156
|
+
```ts
|
|
157
|
+
oidcProvider({
|
|
158
|
+
issuer: 'https://login.acme.example',
|
|
159
|
+
clientId, clientSecret, redirectUri,
|
|
160
|
+
federatedAmr: {
|
|
161
|
+
acr: { 'urn:example:mfa': ['mfa'] }, // upstream acr -> session methods
|
|
162
|
+
amr: { otp: ['otp'], hwk: ['hwk', 'user'] }, // each upstream amr value
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
// session.amr after a sign-in with acr 'urn:example:mfa': ['fed', 'mfa']
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
- The mapping is **fixed configuration of a provider you trust**: nothing in a
|
|
169
|
+
request, a flow or a stored tenant record can add to it, and unmapped
|
|
170
|
+
upstream values grant nothing. A resolved provider (`resolveProvider`) that
|
|
171
|
+
sets it is checked too: only map claims of an issuer whose configuration
|
|
172
|
+
your own operators control, never a tenant's.
|
|
173
|
+
- Only RFC 8176 methods can be granted (`pwd`, `otp`, `hwk`, `user`, `mfa`,
|
|
174
|
+
`sms`, `swk`, `pin`, `fpt`, `face`, `iris`, `retina`, `mca`, `sc`, `tel`,
|
|
175
|
+
`vbm`, `geo`, `kba`, `rba`, `wia`); anything else is a `TypeError`, at wiring
|
|
176
|
+
or when `resolveProvider` answers the provider, and the core records only
|
|
177
|
+
those methods whatever the mapping holds.
|
|
178
|
+
`fed` is always recorded.
|
|
179
|
+
- The provider reports the evidence on `SocialIdentity` (`acr`, `amr`); the
|
|
180
|
+
core reads at most 16 `amr` values and ignores one that is not an array of
|
|
181
|
+
strings. `oidcProvider` and `oidcStepUp` read both from the ID
|
|
182
|
+
token; a provider you write sets them itself.
|
|
183
|
+
- It records methods on the sign-in's session only. A user whose type has a
|
|
184
|
+
second factor still answers its challenge: the upstream `mfa` does not
|
|
185
|
+
replace it. The core keeps no separate `acr` on the session; `amr` is the
|
|
186
|
+
record.
|
|
187
|
+
|
|
148
188
|
## Configuration
|
|
149
189
|
|
|
150
190
|
`social` sits on a user type, beside `password`. With several types, each
|
|
@@ -195,6 +235,7 @@ await clinic.social.start({ provider: 'github' }); // only patient has social: `
|
|
|
195
235
|
`social`; its type then requires it.
|
|
196
236
|
- **`signUp` receives a frozen `SocialProfile`**: `provider`, `accountId`,
|
|
197
237
|
`email`, `emailVerified`, and `name` and `picture` when the provider gave them.
|
|
238
|
+
It also carries the provider's raw reported `amr` when there is one; that grants nothing (only `federatedAmr` does).
|
|
198
239
|
Answer the schema's fields. The e-mail field must equal the provider's (else
|
|
199
240
|
`USER_INVALID`, nothing written). A `password` or `active` in the answer is
|
|
200
241
|
ignored: the user is created active, verified, with no password.
|
|
@@ -438,8 +479,17 @@ export async function link(request: Request): Promise<Response> {
|
|
|
438
479
|
```ts
|
|
439
480
|
await auth.social.list(user); // readonly SocialLink[], oldest first; [] for nobody
|
|
440
481
|
await auth.social.unlink(user, { provider: 'github', accountId }); // true if this call deleted it, false for one not theirs or not there
|
|
482
|
+
await auth.social.countLinks({ provider: 'github' }); // how many accounts are linked through it; 0 for none
|
|
441
483
|
```
|
|
442
484
|
|
|
485
|
+
`countLinks` is what an admin screen calls before deleting a provider: refuse
|
|
486
|
+
while it answers more than `0`. It counts in the partition the instance's
|
|
487
|
+
store is bound to (`createMongoStores(db, { partition })`), so one tenant never
|
|
488
|
+
sees another's links. It needs a store that implements the optional
|
|
489
|
+
`countSocialLinks(provider)`: `createMemoryStores()`, `janus-mongo` and
|
|
490
|
+
`janus-drizzle` do; a store without it makes the call throw `UNSUPPORTED`
|
|
491
|
+
(`UnsupportedError`, `slot` and `operation` set).
|
|
492
|
+
|
|
443
493
|
`unlink` refuses with `LAST_SIGN_IN_METHOD` (409) when the link is the user's
|
|
444
494
|
only way to sign in. It counts **a password, the user's other links and, on a
|
|
445
495
|
type with no password, a verified e-mail** (the e-mail signs in by link or code).
|
package/docs/roadmap.md
CHANGED
|
@@ -84,6 +84,9 @@ Nothing yet.
|
|
|
84
84
|
The last ten, newest first, each with the version it came in. Everything
|
|
85
85
|
before is in the [CHANGELOG](../CHANGELOG.md).
|
|
86
86
|
|
|
87
|
+
- **A guard on `passkeys.signIn`** — next release. `options.guard(user)` runs once the assertion verified, before the passkey's use is recorded and before any session opens, to refuse by policy.
|
|
88
|
+
- **The federated proof in the session** — `federatedAmr` on a social provider maps the upstream `acr` / `amr` into `session.amr` (`mfa` and the like), fixed by configuration and limited to RFC 8176 methods; `oidcProvider` and `oidcStepUp` take it. [#937](https://github.com/softistx/nxgt-janus/issues/937)
|
|
89
|
+
- **Counting a provider's links** — `auth.social.countLinks({ provider })`, backed by the optional `SocialLinkStore.countSocialLinks(provider)` of the memory, MongoDB (per partition) and Drizzle stores, so an app can refuse deleting a provider users are still linked through. [#930](https://github.com/softistx/nxgt-janus/issues/930)
|
|
87
90
|
- **Public on npmjs** — every `@softistx/janus*` package is public on registry.npmjs.org and installs without a token or a scope mapping.
|
|
88
91
|
- **Sealing TOTP secrets again** — `secondFactor.reseal({ batch, after })` seals the secrets of users who do not sign in under the first key, in resumable, idempotent batches, so the old key can be retired. [#915](https://github.com/softistx/nxgt-janus/issues/915)
|
|
89
92
|
- **The methods a session proved** — 0.71.0. `session.amr`, the RFC 8176 methods of the sign-in extended by each step-up, with `authenticatedAt` as the time of the last proof, on `authenticate` and every `SignedIn`; `AMR` and `isMultiFactor` exported. The Mongo, Drizzle (a nullable `amr` column) and Redis stores keep it. [#889](https://github.com/softistx/nxgt-janus/issues/889)
|
package/docs/troubleshooting.md
CHANGED
|
@@ -185,6 +185,7 @@ How the messages are shaped:
|
|
|
185
185
|
- [`TypeError: deviceCookie(): …` (a name, prefix or attribute the browser would refuse)](#typeerror-devicecookie--a-name-prefix-or-attribute-the-browser-would-refuse)
|
|
186
186
|
- [`<call>: a device was given, but janus() has no devices — pass devices: { keys }`](#call-a-device-was-given-but-janus-has-no-devices--pass-devices--keys-)
|
|
187
187
|
- [`<call>: options must be { device }, or left out — the token goes under device`](#call-options-must-be--device--or-left-out--the-token-goes-under-device)
|
|
188
|
+
- [`passkeys.signIn: options.guard must be a function`](#passkeyssignin-optionsguard-must-be-a-function)
|
|
188
189
|
- [`<call>: options.device must be the device token the client holds, or null when it holds none`](#call-optionsdevice-must-be-the-device-token-the-client-holds-or-null-when-it-holds-none)
|
|
189
190
|
- [Every sign-in reports a new device](#every-sign-in-reports-a-new-device)
|
|
190
191
|
- [A new device is never reported: `newDevice` is always `false`](#a-new-device-is-never-reported-newdevice-is-always-false)
|
|
@@ -204,6 +205,7 @@ How the messages are shaped:
|
|
|
204
205
|
- [`janus: social.providers must name at least one provider, or social.resolveProvider must be given`](#janus-socialproviders-must-name-at-least-one-provider-or-socialresolveprovider-must-be-given)
|
|
205
206
|
- [`janus: social.resolveProvider must be a function …`](#janus-socialresolveprovider-must-be-a-function-)
|
|
206
207
|
- [`social.resolveProvider("<name>") must answer a provider …`](#socialresolveprovidername-must-answer-a-provider-)
|
|
208
|
+
- [`federatedAmr: …`](#federatedamr-)
|
|
207
209
|
- [`SIGN_UP_DISABLED` — `social.complete: nobody holds this account's e-mail, and the user type does not sign strangers up`](#sign_up_disabled--socialcomplete-nobody-holds-this-accounts-e-mail-and-the-user-type-does-not-sign-strangers-up)
|
|
208
210
|
- [`EMAIL_NOT_VERIFIED_FOR_LINK` — `social.complete: a user holds this e-mail, and the provider or the account does not vouch for it …`](#email_not_verified_for_link--socialcomplete-a-user-holds-this-e-mail-and-the-provider-or-the-account-does-not-vouch-for-it--sign-in-another-way-then-link-the-account)
|
|
209
211
|
- [`SOCIAL_ACCOUNT_TAKEN` — `social.complete: this social account is already linked to another user`](#social_account_taken--socialcomplete-this-social-account-is-already-linked-to-another-user)
|
|
@@ -211,6 +213,7 @@ How the messages are shaped:
|
|
|
211
213
|
- [`LAST_SIGN_IN_METHOD` — `social.unlink: this is the user's only way to sign in …`](#last_sign_in_method--socialunlink-this-is-the-users-only-way-to-sign-in--set-a-password-or-link-another-account-first)
|
|
212
214
|
- [`EMAIL_UNVERIFIED` — `social.complete: the provider does not vouch for an e-mail, so no account is created`](#email_unverified--socialcomplete-the-provider-does-not-vouch-for-an-e-mail-so-no-account-is-created)
|
|
213
215
|
- [`janus: the user type "<name>" configures social and store.socialLinks is missing …`](#janus-the-user-type-name-configures-social-and-storesociallinks-is-missing-)
|
|
216
|
+
- [`social.countLinks: store.socialLinks does not implement countSocialLinks …`](#socialcountlinks-storesociallinks-does-not-implement-countsociallinks-)
|
|
214
217
|
- [`janus: social.signUp needs a type whose login is its e-mail …`](#janus-socialsignup-needs-a-type-whose-login-is-its-e-mail-)
|
|
215
218
|
|
|
216
219
|
**Passkeys**
|
|
@@ -2463,6 +2466,12 @@ be silently untracked: no token, no notice.
|
|
|
2463
2466
|
await auth.signIn(credentials, { device: token ?? null });
|
|
2464
2467
|
```
|
|
2465
2468
|
|
|
2469
|
+
### `passkeys.signIn: options.guard must be a function`
|
|
2470
|
+
|
|
2471
|
+
**When:** from JavaScript or through a cast, `auth.passkeys.signIn(challenge, response, { guard })` was given something that is not a function.
|
|
2472
|
+
**Why:** it is checked before the challenge is spent, so the visitor loses nothing.
|
|
2473
|
+
**Fix:** pass `guard: (user) => { … }` (it may be async and throws to refuse), or leave it out.
|
|
2474
|
+
|
|
2466
2475
|
### `<call>: options.device must be the device token the client holds, or null when it holds none`
|
|
2467
2476
|
|
|
2468
2477
|
**When:** from JavaScript, or through a cast, a `device` that is neither a
|
|
@@ -2712,6 +2721,13 @@ A `TypeError` at `start`, `link` or `complete`: the resolver answered something
|
|
|
2712
2721
|
**Why:** a bug in the resolver, not a refusal. At `complete` the flow was already spent, so the user starts again.
|
|
2713
2722
|
**Fix:** answer `null` for an unknown name and a built `SocialProvider` otherwise.
|
|
2714
2723
|
|
|
2724
|
+
### `federatedAmr: …`
|
|
2725
|
+
|
|
2726
|
+
A `TypeError` at wiring (`social.providers.<name>`) or when `social.resolveProvider("<name>")` answers a provider: the provider's `federatedAmr` has an unknown key, is not `{ acr?, amr? }`, maps an upstream value to something other than a non-empty array, or lists a method outside RFC 8176.
|
|
2727
|
+
|
|
2728
|
+
**Why:** the mapping decides what the session records, so a bad one is refused rather than guessed. `fed` is always recorded and cannot be listed.
|
|
2729
|
+
**Fix:** keep only `acr` and `amr`, map each upstream value to an array of RFC 8176 methods (`pwd`, `otp`, `hwk`, `user`, `mfa`, `sms`, `swk`, `pin`, `fpt`, `face`, `iris`, `retina`, `mca`, `sc`, `tel`, `vbm`, `geo`, `kba`, `rba`, `wia`), and drop `fed`.
|
|
2730
|
+
|
|
2715
2731
|
### `SIGN_UP_DISABLED` — `social.complete: nobody holds this account's e-mail, and the user type does not sign strangers up`
|
|
2716
2732
|
|
|
2717
2733
|
`SocialError`, 403, carrying `provider`.
|
|
@@ -2781,6 +2797,18 @@ A `TypeError` at wiring: `<where>: the user type "<name>" configures social and
|
|
|
2781
2797
|
const store = { ...createMemoryStores(), ...adapterStores, socialLinks: adapterSocialLinks };
|
|
2782
2798
|
```
|
|
2783
2799
|
|
|
2800
|
+
### `social.countLinks: store.socialLinks does not implement countSocialLinks …`
|
|
2801
|
+
|
|
2802
|
+
An `UnsupportedError` (`UNSUPPORTED`, 501) when `auth.social.countLinks(...)` is called: `social.countLinks: store.socialLinks does not implement countSocialLinks — use a store that does, or implement the method`.
|
|
2803
|
+
|
|
2804
|
+
**When:** `countLinks` on a store whose `socialLinks` slot does not implement the optional `countSocialLinks(provider)`.
|
|
2805
|
+
**Why:** the method is optional on the port, so a store written before it compiles and signs in; only the count needs it.
|
|
2806
|
+
**Fix:** upgrade `@softistx/janus-mongo` or `@softistx/janus-drizzle`, use `createMemoryStores()`, or add the method to your store:
|
|
2807
|
+
|
|
2808
|
+
```ts
|
|
2809
|
+
const socialLinks = { ...mine, countSocialLinks: (provider) => countRows({ provider }) };
|
|
2810
|
+
```
|
|
2811
|
+
|
|
2784
2812
|
### `janus: social.signUp needs a type whose login is its e-mail …`
|
|
2785
2813
|
|
|
2786
2814
|
A `TypeError` at wiring, and a compile error: `<at>: social.signUp needs a type whose login is its e-mail — password.login is "<field>", not "<email field>"`.
|