diff --git a/atproto.md b/atproto.md index 7a52ab4..201fc2a 100644 --- a/atproto.md +++ b/atproto.md @@ -36,6 +36,24 @@ url=$api/com.atproto.repo.getRecord curl -sL "$url?repo=$did&collection=$collection&rkey=$rkey&cid="|jq . ``` +## login + +```sh +# session +host=bsky.social +handle=syui.bsky.social +pass=xxx +url=https://$host/xrpc/com.atproto.server.createSession +curl -sL -X POST -H "Content-Type: application/json" -d "{\"identifier\":\"$handle\",\"password\":\"$pass\"}" $url + +# refresh +j=`!!` +token=`echo $j|jq -r .accessJwt` +refresh=`echo $j|jq -r .refreshJwt` +url=https://$host/xrpc/com.atproto.server.refreshSession +curl -sL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $refresh" $url +``` + ## jq ここでは[aios](https://git.syui.ai/ai/os)にインストールされている[jq](https://github.com/jqlang/jq), [dasel](https://github.com/TomWright/dasel)の`example`をまとめます。