DeaDo
DeaDo
CC#
Created by DeaDo on 7/23/2024 in #help
✅ ASP.NET Core Environment Variables: missing Parameter "clientSecret" for EntraId
The Problem was elsewhere. The Client Secret was set correctly. The Config was just fine. The errer occured, when my OBO flow tried to obtain the token for the ArmClient. I had to refactor my ArmClientBuilder to use the correct Configuration.
23 replies
CC#
Created by DeaDo on 7/23/2024 in #help
✅ ASP.NET Core Environment Variables: missing Parameter "clientSecret" for EntraId
ok ill create a new project & add nothing but this part then ill attempt to create a authenticated client
23 replies
CC#
Created by DeaDo on 7/23/2024 in #help
✅ ASP.NET Core Environment Variables: missing Parameter "clientSecret" for EntraId
i explicitly set it there
23 replies
CC#
Created by DeaDo on 7/23/2024 in #help
✅ ASP.NET Core Environment Variables: missing Parameter "clientSecret" for EntraId
i got that. But it doesn't accept my ClientSecret
23 replies
CC#
Created by DeaDo on 7/23/2024 in #help
✅ ASP.NET Core Environment Variables: missing Parameter "clientSecret" for EntraId
I have a shared secret that allows my API to call Azure Resource Manager. But there is no way to set it. other than appsettings.json Im using environment variables though
23 replies
CC#
Created by DeaDo on 7/23/2024 in #help
✅ ASP.NET Core Environment Variables: missing Parameter "clientSecret" for EntraId
Sry for the Typo in the title
23 replies
CC#
Created by DeaDo on 7/23/2024 in #help
✅ ASP.NET Core Environment Variables: missing Parameter "clientSecret" for EntraId
IDK how to configure this in general. This also fails with the same exception
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApi(options => {}, options => {
options.Instance = "https://login.microsoftonline.com/";
options.ClientId = "XXX";
options.TenantId = "XXX";
options.ClientSecret = "XXX";
})
.EnableTokenAcquisitionToCallDownstreamApi(options => {
options.Instance = "https://login.microsoftonline.com/";
options.ClientId = "XXX";
options.TenantId = "XXX";
options.ClientSecret = "XXX";
})
.AddInMemoryTokenCaches();
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApi(options => {}, options => {
options.Instance = "https://login.microsoftonline.com/";
options.ClientId = "XXX";
options.TenantId = "XXX";
options.ClientSecret = "XXX";
})
.EnableTokenAcquisitionToCallDownstreamApi(options => {
options.Instance = "https://login.microsoftonline.com/";
options.ClientId = "XXX";
options.TenantId = "XXX";
options.ClientSecret = "XXX";
})
.AddInMemoryTokenCaches();
23 replies
CC#
Created by DeaDo on 6/26/2024 in #help
UseStaticFiles for HTML
Thanks for your help @ZZZZZZZZZZZZZZZZZZZZZZZZZ & @canton7. That try_files feature would be useful in UseStaticFiles because it seems that many SSGs rely on that behavior. Ill stick with the Middleware for now. It works & there are no conflicts (at least for my static files)
24 replies
CC#
Created by DeaDo on 6/26/2024 in #help
UseStaticFiles for HTML
the first thing I came up with is a simple middleware:
c#
app.Use(async (context, next) =>
{
await next();
if (context.Request.Path.Value.StartsWith("/docs"))
{
context.Request.Path = context.Request.Path + ".html";
await next();
}
});
c#
app.Use(async (context, next) =>
{
await next();
if (context.Request.Path.Value.StartsWith("/docs"))
{
context.Request.Path = context.Request.Path + ".html";
await next();
}
});
But i don't like it
24 replies
CC#
Created by DeaDo on 6/26/2024 in #help
UseStaticFiles for HTML
Now im looking for something equivalent in asp.net core
24 replies
CC#
Created by DeaDo on 3/13/2023 in #help
Blazor Wasm: Avoiding frequent & slow rerendering of the component
Thank you for your help. Ill try that.
27 replies
CC#
Created by DeaDo on 3/13/2023 in #help
Blazor Wasm: Avoiding frequent & slow rerendering of the component
The images are uploaded by the users frequently But there won't be a lot of traffic in general
27 replies
CC#
Created by DeaDo on 3/13/2023 in #help
Blazor Wasm: Avoiding frequent & slow rerendering of the component
what would you recommend in my situation? Could i also use something like a Headless CMS? I saw a few which had very nice features for formatting the frequently uploaded images and that could eventually solve some other problems i have with the content
27 replies
CC#
Created by DeaDo on 3/13/2023 in #help
Blazor Wasm: Avoiding frequent & slow rerendering of the component
Inside the ItemCard - Component:
@if (Item.ImageData != null)
{
string image = $"data:image/png;base64,{Convert.ToBase64String(Item.ImageData)}";
<img src="@image" loading="lazy"/>
}
@if (Item.ImageData != null)
{
string image = $"data:image/png;base64,{Convert.ToBase64String(Item.ImageData)}";
<img src="@image" loading="lazy"/>
}
maybe this is just very bad?
27 replies
CC#
Created by DeaDo on 3/13/2023 in #help
Blazor Wasm: Avoiding frequent & slow rerendering of the component
the images are not static they are provided by the database I don't know how to do it with urls
27 replies
CC#
Created by DeaDo on 3/13/2023 in #help
Blazor Wasm: Avoiding frequent & slow rerendering of the component
base64 :/
27 replies
CC#
Created by DeaDo on 3/13/2023 in #help
Blazor Wasm: Avoiding frequent & slow rerendering of the component
about 1/s The Images are the problem. If I receive but don't display them, the performance is fine. But if I just show them with a image tag and lazy loading. The UI is blocking. The CSS grow on hover on the Card sometimes has multible seconds delay for example
27 replies
CC#
Created by DeaDo on 3/13/2023 in #help
Blazor Wasm: Avoiding frequent & slow rerendering of the component
@code{
public List<Item> Items { get; set; } = new List<Item>();

protected override async void OnInitialized()
{
CustomClient.OnReceiveSuccess += OnSuccess;
}

private void Success(object? sender, Item item)
{
Items.Add(item);
StateHasChanged();
}
}
@code{
public List<Item> Items { get; set; } = new List<Item>();

protected override async void OnInitialized()
{
CustomClient.OnReceiveSuccess += OnSuccess;
}

private void Success(object? sender, Item item)
{
Items.Add(item);
StateHasChanged();
}
}
27 replies
CC#
Created by DeaDo on 3/13/2023 in #help
Blazor Wasm: Avoiding frequent & slow rerendering of the component
I have a component for the Cardlist and a Component for the Card

@foreach (var item in Items)
{
<ItemCard Item="item" />
}

@foreach (var item in Items)
{
<ItemCard Item="item" />
}
27 replies
CC#
Created by DeaDo on 2/14/2023 in #help
MapPost: Parameters are null
Well i'll just make it the way it is supposed to be. Thx.
9 replies