signIn(options?)
Sends the person to sign in at their own PDS, as your app's OAuth client. They come back to your redirect URI; restore then answers the session.
Your app is its own atproto OAuth client, like Sign in with Google. The person consents to your app and the scopes it asks for. They do not consent to the platform.
Options
| Name | Type | What it is |
|---|---|---|
clientId | string | The https URL of your client metadata. Left out, or on localhost, the loopback client. |
handle | string | Who. A bare name (yourname) is yourname.techne.town; a full handle, a DID or a PDS URL goes as given. None starts at techne.town, which asks. |
signUp | boolean | Create an account at techne.town (its create-account screen). |
scope | string | string[] | The scopes to ask for. The defaults are listed below. |
types | string[] | The types your app writes in their repo, for the default scopes: one repo: scope each. Ignored with scope. |
everything | 'read' | 'write' | Ask for everything the person can reach, for the default scopes: 'read' adds authRead, 'write' adds authRead and authWrite. The consent page shows a large warning. Ignored with scope. |
publish | boolean | Ask to publish community types, for the default scopes: adds registry.publishType. Ignored with scope. From techne-sdk 0.3.1. |
platform | string | The platform's service DID, the scopes' audience. Default TECHNE_PLATFORM_DID, did:web:techne.computer. |
pds | string | The home PDS: where handles resolve, and where a sign-in with no handle and every sign-up start. Default https://pds.techne.town. |
plcUrl | string | The PLC directory a did:plc resolves at. Default plc.directory. |
handleDomain | string | The handle domain a bare name signs in under. Default techne.town. |
state | string | Handed back by the redirect. |
Answers Promise<void>, and the page navigates away.
Around it also in techne-sdk/auth
| Name | Type | What it is |
|---|---|---|
restore({ clientId }) | OAuthSession | null | Finishes a sign-in on the redirect back, else restores the kept session. null when nobody is signed in. Rejects when the person said no. |
signUp({ clientId }) | Promise<void> | signIn with signUp: true. |
signOut({ clientId, session }) | Promise<void> | Revokes the session at its PDS and forgets it here. |
clientMetadata({ clientId, clientName }) | object | The document to serve at clientId. It describes a public browser client with DPoP-bound tokens. |
The default scopes are least privilege: atproto; include:pub.techne.draft.authPermissioned at the platform (the permissioned.* calls); your app's own private space, space:pub.techne.draft.space.private?skey=<appKey>; rpc: scopes for query.listRecords, countRecords and getRecords and for registry.getType and listTypes; and for each of types, a repo: scope, with sync.indexRecord so put can hint what it wrote. everything: 'read' adds authRead, everything: 'write' authRead and authWrite; publish: true (0.3.1) adds registry.publishType. Pass the same options to clientMetadata: the PDS refuses a request beyond what the metadata declares. Permissions says what each scope reaches.
The provider runs restore on mount and connects for you. TechneProvider