• About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us
TechTrendFeed
  • Home
  • Tech News
  • Cybersecurity
  • Software
  • Gaming
  • Machine Learning
  • Smart Home & IoT
No Result
View All Result
  • Home
  • Tech News
  • Cybersecurity
  • Software
  • Gaming
  • Machine Learning
  • Smart Home & IoT
No Result
View All Result
TechTrendFeed
No Result
View All Result

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

Admin by Admin
April 22, 2025
Home Software
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 a straightforward HTTP-based protocol that allows a consumer to find details about different customers or sources on the web through the use of their electronic mail tackle or different figuring out data. The WebFinger protocol is essential for Mastodon as a result of it permits 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 acquainted with 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 a straightforward HTTP-based protocol that allows a consumer or search to find details about different customers or sources on the web through the use of their electronic 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 consumer sends a WebFinger request to a server, utilizing the e-mail tackle or different figuring out data of the consumer or useful resource they’re attempting to find.

  2. The server seems up the requested data in its database and returns a JSON object containing the details about the consumer or useful resource. This JSON object is known as a “useful resource descriptor.”

  3. The consumer’s shopper receives the useful resource descriptor and shows the knowledge to the consumer.

The useful resource descriptor accommodates numerous varieties of details about the consumer or useful resource, reminiscent of their identify, profile image, and hyperlinks to their social media accounts or different on-line sources. It may possibly additionally embrace different varieties of data, such because the consumer’s public key, which can be utilized to determine a safe reference to the consumer.

There’s an ideal 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}

Word that Mastodon consumer names begin with @ so they’re @username@someserver.com. Similar to twiter could be @shanselman@twitter.com I may 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 ought to be returned as a mime sort of software/jrd+json

My website is an ASP.NET Razor Pages website, 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. Word I’ve to double escape the @@ websites as a result of it is Razor.

@web page
@{
Structure = null;
this.Response.ContentType = "software/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 might need to take within the url with the consumer’s identify, after which map it to their aliases and return these appropriately.

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

So long as your server returns the appropriate 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 seems like Twitter circa 2007 besides it isn’t owned by anybody and relies 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 e book creator.

facebook
bluesky
subscribe
About   Publication

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










Tags: discoverabilityDomainHostingMastodonProtocolserveruserWebFinger
Admin

Admin

Next Post
SmartThings Weblog

SmartThings Weblog

Leave a Reply Cancel reply

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

Trending.

Discover Vibrant Spring 2025 Kitchen Decor Colours and Equipment – Chefio

Discover Vibrant Spring 2025 Kitchen Decor Colours and Equipment – Chefio

May 17, 2025
Reconeyez Launches New Web site | SDM Journal

Reconeyez Launches New Web site | SDM Journal

May 15, 2025
Safety Amplified: Audio’s Affect Speaks Volumes About Preventive Safety

Safety Amplified: Audio’s Affect Speaks Volumes About Preventive Safety

May 18, 2025
Flip Your Toilet Right into a Good Oasis

Flip Your Toilet Right into a Good Oasis

May 15, 2025
Apollo joins the Works With House Assistant Program

Apollo joins the Works With House Assistant Program

May 17, 2025

TechTrendFeed

Welcome to TechTrendFeed, your go-to source for the latest news and insights from the world of technology. Our mission is to bring you the most relevant and up-to-date information on everything tech-related, from machine learning and artificial intelligence to cybersecurity, gaming, and the exciting world of smart home technology and IoT.

Categories

  • Cybersecurity
  • Gaming
  • Machine Learning
  • Smart Home & IoT
  • Software
  • Tech News

Recent News

Report: AI coding productiveness positive aspects cancelled out by different friction factors that sluggish builders down

Report: AI coding productiveness positive aspects cancelled out by different friction factors that sluggish builders down

July 10, 2025
How authorities cyber cuts will have an effect on you and your enterprise

How authorities cyber cuts will have an effect on you and your enterprise

July 9, 2025
  • About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us

© 2025 https://techtrendfeed.com/ - All Rights Reserved

No Result
View All Result
  • Home
  • Tech News
  • Cybersecurity
  • Software
  • Gaming
  • Machine Learning
  • Smart Home & IoT

© 2025 https://techtrendfeed.com/ - All Rights Reserved