Browse code

add indieauth login post

Joseph Weston authored on 31/03/2021 06:37:04
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+---
2
+date: 2021-03-30T21:11:42-07:00
3
+title: "Bash one-liner for IndieLogin"
4
+tags:
5
+  - coding
6
+  - indieweb
7
+---
8
+Recently I've been updating my website to be more [IndieWeb](https://indieweb.org/) ready.
9
+In addition to adding a `h-card` to my homepage I also came across
10
+[IndieLogin](https://indielogin.com/), which allows you to use your personal
11
+domain to log in to services that support it.
12
+
13
+In order to get this working I just needed to include a link to my PGP key
14
+from my homepage:
15
+```html
16
+<a class="u-key" rel="pgpkey" type="application/pgp-keys" href="/pgp.asc"></a>
17
+```
18
+When logging in at IndieLogin I can then select to use my PGP key for authentication,
19
+and I am asked to sign a short message using my key. To make working
20
+with PGP less cumbersome I use the following one-line script:
21
+```bash
22
+#!/bin/bash
23
+echo $1 | gpg --clearsign 2>/dev/null | xsel -ib
24
+```
25
+which I invoke with `dmenu` like:
26
+```bash
27
+auth dee3ddb27870390b62b7ae1cef44d25bf4128aafaab5ffc9c80f5cba8392f5f7
28
+```
29
+which signs the message and sends the signature to the clipboard.
30
+From there I just need to paste into the login form and I'm logged in!