62°F

Aaron Parecki

  • Articles
  • Notes
  • Photos
  • How to use your own domain as your BlueSky handle

    March 7, 2023

    I recently got access to the BlueSky beta, and decided to poke around to see what it's all about. I will save the details of what it is and how I feel about it for a different post. However, one of the first things you do when you sign up is choose a username that exists under the bsky.app domain. I have zero interest in another name rush where everyone tries to claim the shortest username possible, so I went with aaronpk.bsky.app rather than trying to get a or apk.

    But, as I was poking around the app and replying to a few people, it just didn't feel like "me" yet. I don't care about renting a name in someone else's space. Yesterday, Jay Graber posted on the BlueSky blog all about supporting custom domains as identities in BlueSky. Naturally I was curious to try this out myself, but there were no technical details available in the blog post.

    Update: The BlueSky app now supports changing your username to your domain name within the app itself! You no longer need to use the below process! You can use my notes below if you're curious about playing with the API directly in order to build other kinds of integrations.

    When I opened my BlueSky timeline, I saw a few people mentioning that they had figured out how to do it even before the app supported it natively. I did some digging around, and jik pointed me to the right places in the AT Proto docs, and I was able to change my handle to aaronpk.com!

    Below are the instructions for how to do this yourself. Please note that these instructions will be made obsolete in a week or two since the BlueSky developers are planning on shipping first class support for custom domains in the app and you won't need to do this workaround for long.

    Overview

    The rough process for this is:

    • Create a DNS TXT record on your domain with the value of your underlying BlueSky ID
    • Get a token for your account (e.g. "log in" to your account from an HTTP client)
    • Update your profile with your new domain

    Note: To make these POST requests, you'll need an HTTP client that can POST in JSON format. You can use cURL, httpie, Postman, or write code in whatever language you want. I'll use httpie for the examples.

    Get a token for your account

    First, you need to "log in" to your account. This process will return an access token you can use to update your profile. Logging in will also tell you your DID, the unique identifier for your underlying account. (The "handle" on your account is more like a display name, and that's how your account can end up being portable across domains as well as BlueSky servers later.)

    Call the com.atproto.server.createSession method with your email and password you used to sign up. (Type this all on one line, I've just split it into multiple lines for readability. Also, again, if you're using cURL or another HTTP client, make sure you send this payload as JSON, not form-encoded.)

    http post https://bsky.social/xrpc/com.atproto.server.createSession
                identifier=user@example.com password=hunter2
    

    The response will be a JSON document with your access token as well as DID:

    HTTP/1.1 200 OK
    Access-Control-Allow-Origin: *
    Connection: keep-alive
    Content-Length: 609
    Content-Type: application/json; charset=utf-8
    Date: Tue, 07 Mar 2023 15:29:38 GMT
    ETag: W/"261-15oNf47+gL0kDnvlsvzpUK0ocx8"
    X-Powered-By: Express
    
    {
        "accessJwt": "eyJh...",
        "did": "did:plc:s2koow7r6t7tozgd4slc3dsg",
        "handle": "aaronpk.bsky.app",
        "email": "aaron@parecki.com",
        "refreshJwt": "eyJh..."
    }
    

    Create a DNS Record

    Go to your domain registrar and create a new TXT record on your domain.

    • Subdomain: _atproto
    • Value: did=did:plc:XXXXXXXXX
    • TTL: Default

    In my case, the domain I wanted to use is aaronpk.com, so I would create a new subdomain _atproto.aaronpk.com, with the value did=did:plc:s2koow7r6t7tozgd4slc3dsg.

    _atproto.aaronpk.com TXT did=did:plc:s2koow7r6t7tozgd4slc3dsg
    

    Update your Profile

    Wait a little while to make sure the DNS entry takes effect. Then you can update your profile with your new domain by running the com.atproto.identity.updateHandle method.

    Use the value of the accessJwt you got from the first request. (Again, type this out all on one line.)

    http post https://bsky.social/xrpc/com.atproto.identity.updateHandle 
          Authorization:"Bearer eyJ..." 
          handle=aaronpk.com 
    

    You won't see a response, but that means it worked! Next time you open the app, you'll probably see a bunch of errors. So log out of the app, and log back in! Right now, you'll need to use your email address to log in instead of your handle, but they are going to fix that in a future update.

    Now you should see your new domain as your handle in the BlueSky app!

    Once again, this will all be obsolete once they ship this feature in the app itself! Here's a sneak peek from Paul of what the interface will look like!

    More Fun

    Once you've got this far, you can start to use the API for some other fun things!

    Portland, Oregon • 35°F
    Tue, Mar 7, 2023 7:17am -08:00 #indieweb #bluesky #atproto
    1 like 1 bookmark 2 replies 2 mentions
    • Ryan Barrett
    • James' Coffee Blog
    • david celis :official: xoxo.zone/@davidcelis

      @rabble @aaronpk i'm more curious about how you set up cross-posting tbh; the "Applications model" page in their docs has a reasonable example to create a post but i wish there was more detail about each method. i post a lot of pics and it seems like there's support for blob uploads but i can't find documentation on how to hook everything together

      Tue, Mar 7, 2023 10:01am -08:00 (via brid.gy)
    • Barry Frost barryfrost.com

      Thanks for the sleuthing, Aaron. That worked perfectly for me.

      Tue, Mar 7, 2023 8:20am -08:00

    Other Mentions

    • Barry Frost barryfrost.com

      I got access to the Bluesky private beta (thanks Ryan!) and have been kicking the iOS app’s tyres. The app experience is basic but familiar. You can clearly see its Twitter roots. I was also pleased to be able to follow Aaron’s guide to using my personal domain as my handle.

      The AT Protocol is also nicely designed. The federated social network world is certainly heating up.

      Tue, Mar 7, 2023 9:48am -08:00
    • jacky.wtf/about

      @aaronpk talks about using their own domain for @bluesky at https://aaronparecki.com/2023/03/07/3/bluesky-custom-domain. Nice to see what's coming over the wall over there. A bit disappointed that it's still locked to iOS (it does make it very closed to those who could benefit in a new platform on a global scale).

      Tue, Mar 7, 2023 7:48am -08:00
Posted in /articles using quill.p3k.io

Hi, I'm Aaron Parecki, Director of Identity Standards at Okta, and co-founder of IndieWebCamp. I maintain oauth.net, write and consult about OAuth, and participate in the OAuth Working Group at the IETF. I also help people learn about video production and livestreaming. (detailed bio)

I've been tracking my location since 2008 and I wrote 100 songs in 100 days. I've spoken at conferences around the world about owning your data, OAuth, quantified self, and explained why R is a vowel. Read more.

  • Director of Identity Standards at Okta
  • IndieWebCamp Founder
  • OAuth WG Editor
  • OpenID Board Member

  • 🎥 YouTube Tutorials and Reviews
  • 🏠 We're building a triplex!
  • ⭐️ Life Stack
  • ⚙️ Home Automation
  • All
  • Articles
  • Bookmarks
  • Notes
  • Photos
  • Replies
  • Reviews
  • Trips
  • Videos
  • Contact
© 1999-2025 by Aaron Parecki. Powered by p3k. This site supports Webmention.
Except where otherwise noted, text content on this site is licensed under a Creative Commons Attribution 3.0 License.
IndieWebCamp Microformats Webmention W3C HTML5 Creative Commons
WeChat ID
aaronpk_tv