No description
Find a file
2023-09-27 16:47:00 +01:00
src better error visibility 2023-09-27 16:47:00 +01:00
tests exported from gts_emoji_importer 2023-09-27 15:55:07 +01:00
.gitignore exported from gts_emoji_importer 2023-09-27 15:55:07 +01:00
fedi_auth.nimble increment version 2023-09-27 16:32:59 +01:00
nim.cfg exported from gts_emoji_importer 2023-09-27 15:55:07 +01:00
readme.md updated readme 2023-09-27 15:58:36 +01:00

Fedi Auth

A basic fediverse authentication library for Nim

Usage

Please see tests/login.nim for a working example

let client = newFediClient()
client.instance = "your-home-instance.com"
client.name = "MyReallyCoolApp"
let token = client.getToken()
if client.verify(): echo "Verified!"

You can then use this library to send your own HttpClient requests with the Authorization header:

let c = newHttpClient()
c.headers = newHttpHeaders({
  "Authorization": client.tokenStr
})

client.tokenStr is a procedure that simply returns

Bearer YOURTOKEN

Testing

This library has been tested with GoToSocial, Mastodon, Pleroma, Akkoma and Rebased. It should, in theory, work with any fediverse instance that implements MastoAPI endpoints for authentication

---

Have fun!
Any comments, let me know on the fediverse at @paul@notnull.space