Files
pubky-core/examples/authz
SHAcollision 6386f1ae43 feat: signup tokens (#80)
* Add admin and signup config

* Add signup tokens API, db, admin endpoint

* Add client api for signup codes

* Add tests and fixes

* Fix wasm build

* Lint

* enable and use same admin pswd on all test homeservers

* fix pr review comments

* Add nodejs and browser signup token to tests

* update signup example

* admin authing as layer

* Update pubky-homeserver/src/core/routes/auth.rs

Co-authored-by: Severin Alexander Bühler <8782386+SeverinAlexB@users.noreply.github.com>

* Update pubky-homeserver/src/core/routes/auth.rs

Co-authored-by: Severin Alexander Bühler <8782386+SeverinAlexB@users.noreply.github.com>

* rename getSignupToken util

* add is_used() SignupToken method

---------

Co-authored-by: Severin Alexander Bühler <8782386+SeverinAlexB@users.noreply.github.com>
2025-03-17 15:58:58 -04:00
..
2025-02-10 18:49:40 +03:00
2025-03-17 15:58:58 -04:00
2025-02-12 21:15:09 +03:00

Pubky Auth Example

This example shows 3rd party authorization in Pubky.

It consists of 2 parts:

  1. 3rd party app: A web component showing the how to implement a Pubky Auth widget.
  2. Authenticator CLI: A CLI showing the authenticator (key chain) asking user for consent and generating the AuthToken.

Usage

First you need to be running a local testnet Homeserver, in the root of this repo run

cargo run --bin pubky_testnet

Run the frontend of the 3rd party app

cd ./3rd-party-app
npm start

Copy the Pubky Auth URL from the frontend.

Finally run the CLI to paste the Pubky Auth in.

cargo run --bin authenticator <RECOVERY_FILE> "<Auth_URL>" [Testnet]

Where the auth url should be within qutoatino marks, and the Testnet is an option you can set to true to use the local homeserver

You should see the frontend reacting by showing the success of authorization and session details.