Improve integration with Aspire #4
Labels
No labels
breaking-change
bug
documentation
duplicate
enhancement
good first issue
help wanted
performance
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Grandiras/ATProto.NET#4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
builder.Services.AddAtProtoAuthentication(options =>
{
options.ClientName = "Digital Independence Dashboard";
options.LoginPath = "/login";
// AT Proto loopback clients require http:// — derive the HTTP URL from ASPNETCORE_URLS
var urls = builder.Configuration["ASPNETCORE_URLS"] ?? "";
var httpUrl = urls.Split(';').FirstOrDefault(u => u.TrimStart().StartsWith("http://", StringComparison.OrdinalIgnoreCase));
if (!string.IsNullOrEmpty(httpUrl)) options.BaseUrl = httpUrl.Replace("://localhost", "://127.0.0.1", StringComparison.OrdinalIgnoreCase);
options.ClaimsFactory = result =>
[
new Claim(ClaimTypes.NameIdentifier, result.Did),
new Claim(ClaimTypes.Name, result.Handle),
new Claim(ClaimTypes.Role, result.Handle == "grandiras.net" ? "Admin" : "User"),
];
});