@samebase/identity-broker 0.9.1 → 0.9.3
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 +16 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,10 +5,22 @@ connections once, such as GitHub, Google and email codes, and signs users in to
|
|
|
5
5
|
broker keeps no user accounts and no sessions: every sign-in goes upstream again, and each app
|
|
6
6
|
creates its own user from the `id_token` it receives.
|
|
7
7
|
|
|
8
|
+

|
|
9
|
+
|
|
8
10
|
Why: every new app otherwise needs its own OAuth app registrations and its own email sender, and a
|
|
9
11
|
preview deployment with a fresh callback URL cannot have them at all. With the broker, an app
|
|
10
12
|
registers each deployment as a client at deploy time and never touches GitHub or Google.
|
|
11
13
|
|
|
14
|
+
## Start from our hub
|
|
15
|
+
|
|
16
|
+
A hub is a small Convex app that mounts this component.
|
|
17
|
+
[`apps/identity-hub`](https://github.com/samebase/samebase/tree/main/apps/identity-hub) is the hub
|
|
18
|
+
we run in production, and it is also the example: there is no separate template. To run your own,
|
|
19
|
+
copy that folder and change the values in `alchemy.run.ts` and `convex/connectors.ts`, or ask your
|
|
20
|
+
agent to do it. Its
|
|
21
|
+
[README](https://github.com/samebase/samebase/blob/main/apps/identity-hub/README.md) has the deploy
|
|
22
|
+
steps.
|
|
23
|
+
|
|
12
24
|
## What it is
|
|
13
25
|
|
|
14
26
|
- `@samebase/identity-broker`: a Convex component plus the host-side endpoints. Authorization code
|
|
@@ -18,14 +30,15 @@ registers each deployment as a client at deploy time and never touches GitHub or
|
|
|
18
30
|
- Connectors are configuration: any OAuth 2.0 provider that publishes RFC 8414 metadata, any OpenID
|
|
19
31
|
Connect provider, and an email code sent by your own action. `github()`, `google()` and `email()`
|
|
20
32
|
are included.
|
|
21
|
-
- A hub is a small Convex app that mounts the component.
|
|
22
|
-
[`apps/identity-hub`](https://github.com/samebase/samebase/tree/main/apps/identity-hub) is ours.
|
|
23
|
-
To start your own, ask your agent to copy that folder.
|
|
24
33
|
- `Convex.HubClient` of [`@samebase/alchemy-convex`](https://github.com/samebase/alchemy-convex), an
|
|
25
34
|
Alchemy v2 resource, registers a deployment as a client at deploy time.
|
|
26
35
|
|
|
27
36
|
## Mount it
|
|
28
37
|
|
|
38
|
+
```sh
|
|
39
|
+
npm install @samebase/identity-broker
|
|
40
|
+
```
|
|
41
|
+
|
|
29
42
|
```ts
|
|
30
43
|
// convex/convex.config.ts
|
|
31
44
|
import { defineApp } from "convex/server";
|
package/package.json
CHANGED