• About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us
AimactGrow
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing
No Result
View All Result
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing
No Result
View All Result
AimactGrow
No Result
View All Result

Use your personal person @ area for Mastodon discoverability with the WebFinger Protocol with out internet hosting a server

Admin by Admin
April 7, 2025
Home Coding
Share on FacebookShare on Twitter



Mastodon is a free, open-source social networking service that’s decentralized and distributed. It was created in 2016 as an alternative choice to centralized social media platforms reminiscent of Twitter and Fb.

One of many key options of Mastodon is using the WebFinger protocol, which permits customers to find and entry details about different customers on the Mastodon community. WebFinger is an easy HTTP-based protocol that allows a person to find details about different customers or sources on the web through the use of their e mail tackle or different figuring out data. The WebFinger protocol is necessary for Mastodon as a result of it allows customers to search out and observe one another on the community, no matter the place they’re hosted.

WebFinger makes use of a “well-known” path construction when calling an area. You might be accustomed to the robots.txt conference. All of us simply agree that robots.txt will sit on the high path of everybody’s area.

The WebFinger protocol is an easy HTTP-based protocol that allows a person or search to find details about different customers or sources on the web through the use of their e mail tackle or different figuring out data. My is first identify eventually identify .com, so…my private WebFinger API endpoint is right here https://www.hanselman.com/.well-known/webfinger

The concept is that…

  1. A person sends a WebFinger request to a server, utilizing the e-mail tackle or different figuring out data of the person or useful resource they’re attempting to find.

  2. The server appears up the requested data in its database and returns a JSON object containing the details about the person or useful resource. This JSON object is named a “useful resource descriptor.”

  3. The person’s shopper receives the useful resource descriptor and shows the data to the person.

The useful resource descriptor incorporates varied kinds of details about the person or useful resource, reminiscent of their identify, profile image, and hyperlinks to their social media accounts or different on-line sources. It could possibly additionally embody different kinds of data, such because the person’s public key, which can be utilized to ascertain a safe reference to the person.

There’s an excellent explainer right here as properly. From that web page:

When somebody searches for you on Mastodon, your server will probably be queried for accounts utilizing an endpoint that appears like this:

GET https://${MASTODON_DOMAIN}/.well-known/webfinger?useful resource=acct:${MASTODON_USER}@${MASTODON_DOMAIN}

Notice that Mastodon person names begin with @ so they’re @username@someserver.com. Identical to twiter could be @shanselman@twitter.com I might be @shanselman@hanselman.com now!

Searching for me with Mastodon

So maybe https://www.hanselman.com/.well-known/webfinger?useful resource=acct:FRED@HANSELMAN.COM

Mine returns

{
"topic":"acct:shanselman@hachyderm.io",
"aliases":
[
"https://hachyderm.io/@shanselman",
"https://hachyderm.io/users/shanselman"
],
"hyperlinks":
[
{
"rel":"http://webfinger.net/rel/profile-page",
"type":"text/html",
"href":"https://hachyderm.io/@shanselman"
},
{
"rel":"self",
"type":"application/activity+json",
"href":"https://hachyderm.io/users/shanselman"
},
{
"rel":"http://ostatus.org/schema/1.0/subscribe",
"template":"https://hachyderm.io/authorize_interaction?uri={uri}"
}
]
}

This file needs to be returned as a mime sort of utility/jrd+json

My web site is an ASP.NET Razor Pages web site, so I simply did this in Startup.cs to map that well-known URL to a web page/route that returns the JSON wanted.

providers.AddRazorPages().AddRazorPagesOptions(choices =>
{
choices.Conventions.AddPageRoute("/robotstxt", "/Robots.Txt"); //i did this earlier than, not wanted
choices.Conventions.AddPageRoute("/webfinger", "/.well-known/webfinger");
choices.Conventions.AddPageRoute("/webfinger", "/.well-known/webfinger/{val?}");
});

then I made a webfinger.cshtml like this. Notice I’ve to double escape the @@ websites as a result of it is Razor.

@web page
@{
Format = null;
this.Response.ContentType = "utility/jrd+json";
}
{
"topic":"acct:shanselman@hachyderm.io",
"aliases":
[
"https://hachyderm.io/@@shanselman",
"https://hachyderm.io/users/shanselman"
],
"hyperlinks":
[
{
"rel":"http://webfinger.net/rel/profile-page",
"type":"text/html",
"href":"https://hachyderm.io/@@shanselman"
},
{
"rel":"self",
"type":"application/activity+json",
"href":"https://hachyderm.io/users/shanselman"
},
{
"rel":"http://ostatus.org/schema/1.0/subscribe",
"template":"https://hachyderm.io/authorize_interaction?uri={uri}"
}
]
}

This can be a static response, but when I used to be internet hosting pages for a couple of particular person I would need to take within the url with the person’s identify, after which map it to their aliases and return these appropriately.

Even simpler, you may simply use the JSON file of your personal Mastodon server’s webfinger response and SAVE IT as a static json file and replica it to your personal server!

So long as your server returns the best JSON from that well-known URL then it’s going to work.

So that is my template https://hachyderm.io/.well-known/webfinger?useful resource=acct:shanselman@hachyderm.io from the place I am hosted now.

If you wish to get began with Mastodon, begin right here. https://github.com/joyeusenoelle/GuideToMastodon/ it appears like Twitter circa 2007 besides it isn’t owned by anybody and is predicated on internet requirements like ActivityPub.

Hope this helps!




About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, guide, father, diabetic, and Microsoft worker. He’s a failed stand-up comedian, a cornrower, and a ebook writer.

facebook
bluesky
subscribe
About   E-newsletter

Internet hosting By
Hosted on Linux using .NET in an Azure App Service










Tags: discoverabilitydomainhostingMastodonProtocolServeruserWebFinger
Admin

Admin

Next Post
AI Avatar in Court docket: Decide’s Response Disappoints

AI Avatar in Court docket: Decide's Response Disappoints

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended.

Norman Reedus Open To Be In Demise Stranding Film If He is Requested

Norman Reedus Open To Be In Demise Stranding Film If He is Requested

May 16, 2025
HoYoverse’s Animal Crossing-like Petit Planet’s beta kicks off this November

HoYoverse’s Animal Crossing-like Petit Planet’s beta kicks off this November

October 23, 2025

Trending.

AI-Assisted Menace Actor Compromises 600+ FortiGate Gadgets in 55 Nations

AI-Assisted Menace Actor Compromises 600+ FortiGate Gadgets in 55 Nations

February 23, 2026
10 tricks to begin getting ready! • Yoast

10 tricks to begin getting ready! • Yoast

July 21, 2025
Exporting a Material Simulation from Blender to an Interactive Three.js Scene

Exporting a Material Simulation from Blender to an Interactive Three.js Scene

August 20, 2025
Introducing Sophos Endpoint for Legacy Platforms – Sophos Information

Introducing Sophos Endpoint for Legacy Platforms – Sophos Information

August 28, 2025
Design Has By no means Been Extra Vital: Inside Shopify’s Acquisition of Molly

Design Has By no means Been Extra Vital: Inside Shopify’s Acquisition of Molly

September 8, 2025

AimactGrow

Welcome to AimactGrow, your ultimate source for all things technology! Our mission is to provide insightful, up-to-date content on the latest advancements in technology, coding, gaming, digital marketing, SEO, cybersecurity, and artificial intelligence (AI).

Categories

  • AI
  • Coding
  • Cybersecurity
  • Digital marketing
  • Gaming
  • SEO
  • Technology

Recent News

What The USB Port On A Soundbar Is Actually For

What The USB Port On A Soundbar Is Actually For

March 16, 2026
Amy Madigan’s historic Oscars 2026 win echoes Heath Ledger’s Joker

Amy Madigan’s historic Oscars 2026 win echoes Heath Ledger’s Joker

March 16, 2026
  • About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us

© 2025 https://blog.aimactgrow.com/ - All Rights Reserved

No Result
View All Result
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing

© 2025 https://blog.aimactgrow.com/ - All Rights Reserved