Activities of "Fabio.Zinesi"

Hi Mailming,

i mean no internet or offline.

The answer generated by AI could work?

Question

Hi,

we have a tiered application with blazor and SQL Server.

I need to make the app working also with no connection.

It's possible to create a local middleware with the same API and a local database?

i'll check it

this is the code in AuthServerModule.cs in ConfigureServices(context)

....

    context.Services.AddAuthentication().AddMicrosoftIdentityWebApp(configuration.GetSection("AzureAd"));

    context.Services.Configure<OpenIdConnectOptions>(OpenIdConnectDefaults.AuthenticationScheme, options =>
    {
        options.Authority = "https://login.microsoftonline.com/" + configuration["AzureAd:TenantId"] + "/v2.0/";
        options.ClientId = configuration["AzureAd:ClientId"];
        options.ResponseType = OpenIdConnectResponseType.CodeIdToken;
        options.CallbackPath = configuration["AzureAd:CallbackPath"];
        options.ClientSecret = configuration["AzureAd:ClientSecret"];
        options.RequireHttpsMetadata = false;
        options.SaveTokens = true;
        options.GetClaimsFromUserInfoEndpoint = true;

        options.SignInScheme = IdentityConstants.ExternalScheme;

        options.Scope.Add("email");
        options.Scope.Add("openid");
        options.Scope.Add("offline_access");
        options.Scope.Add("profile");
        
        options.ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "sub");
    });
    

....

My application is Blazor Web App.

I need to use the token also in the API controllers and in the front end.

Probably i need to store the received token but i can't understand how to do it.

Hi berkansasmaz, i solved the issue,

I have only one problem. I need to save and store the AD access_token but is always blank. How i have to do and where? In the AuthServer or in the Host?

I need to use use it in the Blazora Page.

Hi Berkansasmaz,

i have already test the four resource with no success.

If i use AddOpenIdConnect it work but i have to use AddMicrosoftIdentityWebApp

This is my code:


context.Services.AddAuthentication().AddMicrosoftIdentityWebApp(options =>
{
    options.Instance = "https://login.microsoftonline.com/";
    options.TenantId = configuration["AzureAd:TenantId"];
    options.ClientId = configuration["AzureAd:ClientId"];
    options.ClientSecret = configuration["AzureAd:ClientSecret"];
    //options.CallbackPath = configuration["AzureAd:CallbackPath"];
    //options.ResponseType = OpenIdConnectResponseType.CodeIdToken;
    options.ResponseType = "code";
    options.RequireHttpsMetadata = true;
    options.SaveTokens = true;
    options.GetClaimsFromUserInfoEndpoint = true;

    options.Scope.Add("email");
    options.Scope.Add("openid");
    options.Scope.Add("offline_access");
    options.Scope.Add("profile");
    //options.Scope.Add("https://analysis.windows.net/powerbi/api/Dataset.ReadWrite.All");
    //options.Scope.Add("https://analysis.windows.net/powerbi/api/Workspace.Read.All");

    options.SignInScheme = IdentityConstants.ExternalScheme;

    options.ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "sub");


    options.Events = new OpenIdConnectEvents
    {
        OnTokenValidated = context =>
        {
            // Log token claims
            var claims = context.Principal.Claims;
            foreach (var claim in claims)
            {
                Console.WriteLine($"{claim.Type}: {claim.Value}");
            }
            return Task.CompletedTask;
        },
        OnAuthenticationFailed = context =>
        {
            Console.WriteLine($"Authentication failed: {context.Exception.Message}");
            return Task.CompletedTask;
        }
    };

});

When i login i get the following error:

2025-06-26 21:32:53.327 +02:00 [DBG] The event OpenIddict.Validation.OpenIddictValidationEvents+ProcessRequestContext was successfully processed by OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ResolveRequestUri. 2025-06-26 21:32:53.327 +02:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ResolveRequestUri. 2025-06-26 21:32:53.327 +02:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.OpenIddictServerHandlers+InferEndpointType. 2025-06-26 21:32:53.327 +02:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by Volo.Abp.Account.Web.Pages.Account.OpenIddictImpersonateInferEndpointType. 2025-06-26 21:32:53.327 +02:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ValidateTransportSecurityRequirement. 2025-06-26 21:32:53.327 +02:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ValidateHostHeader. 2025-06-26 21:32:53.328 +02:00 [DBG] The event OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext was successfully processed by OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ValidateHostHeader. 2025-06-26 21:32:53.328 +02:00 [DBG] The event OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext was successfully processed by OpenIddict.Validation.OpenIddictValidationHandlers+EvaluateValidatedTokens. 2025-06-26 21:32:53.328 +02:00 [DBG] The event OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext was successfully processed by OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ExtractAccessTokenFromAuthorizationHeader. 2025-06-26 21:32:53.328 +02:00 [DBG] The event OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext was successfully processed by OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ExtractAccessTokenFromBodyForm. 2025-06-26 21:32:53.328 +02:00 [DBG] The event OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext was successfully processed by OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ExtractAccessTokenFromQueryString. 2025-06-26 21:32:53.328 +02:00 [DBG] The event OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext was successfully processed by OpenIddict.Validation.OpenIddictValidationHandlers+ValidateRequiredTokens. 2025-06-26 21:32:53.328 +02:00 [DBG] The event OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext was marked as rejected by OpenIddict.Validation.OpenIddictValidationHandlers+ValidateRequiredTokens. 2025-06-26 21:32:53.328 +02:00 [DBG] AuthenticationScheme: OpenIddict.Validation.AspNetCore was not authenticated.

I have to use Microsoft.Web.Identity as method of atuhentication

Hi,

i have to add Microsoft Web Identity as External Login Provider but i'm not able to understand where to customize the code. Do you have an example?

I'am creating a blazor web app to show some PowerBI reports in a PowerBI page. I'am using separate authserver.

I need to login to azure, store the the token, open the blazor page, retrieve the token, retrieve the report by the PowerBiServiceApi and show it in the page.

Someone can guide me to do this?

I've already tried the solution by @Anjali_Musmade on the question 5720 but with no success in Blazor Web App.

Question
  • ABP Framework version: v8.3.4
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server,
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

By the suite I had generated a crud page.

I create a lookup navigation with type "Modal" but the source code is always for "TypeAhead"

The code generated is:

How to create a pick up modal?

Showing 1 to 10 of 52 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.2.0-preview. Updated on February 12, 2026, 08:27
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.