hi
I still can't reproduce your error but you can try code below:
PostConfigureServices
using System;
using System.Linq;
using System.Net.Http;
using AbpSolution1.Blazor.Client.Navigation;
using AbpSolution1.Localization;
using Blazorise.Bootstrap5;
using Blazorise.Icons.FontAwesome;
using Localization.Resources.AbpUi;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using OpenIddict.Abstractions;
using Volo.Abp.Account.Pro.Admin.Blazor.WebAssembly;
using Volo.Abp.AspNetCore.Components.Web.LeptonXTheme;
using Volo.Abp.AspNetCore.Components.Web.Theming.Routing;
using Volo.Abp.AspNetCore.Components.Web.Theming.Toolbars;
using Volo.Abp.AspNetCore.Components.WebAssembly;
using Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXTheme;
using Volo.Abp.AuditLogging.Blazor.WebAssembly;
using Volo.Abp.Autofac.WebAssembly;
using Volo.Abp.AutoMapper;
using Volo.Abp.Identity.Pro.Blazor.Server.WebAssembly;
using Volo.Abp.LanguageManagement.Blazor.WebAssembly;
using Volo.Abp.LeptonX.Shared;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.OpenIddict.Pro.Blazor.WebAssembly;
using Volo.Abp.SettingManagement.Blazor.WebAssembly;
using Volo.Abp.TextTemplateManagement.Blazor.WebAssembly;
using Volo.Abp.UI.Navigation;
using Volo.Chat.Blazor.WebAssembly;
namespace AbpSolution1.Blazor.Client;
[DependsOn(
typeof(AbpSettingManagementBlazorWebAssemblyModule),
typeof(AbpAutofacWebAssemblyModule),
typeof(AbpAspNetCoreComponentsWebAssemblyLeptonXThemeModule),
typeof(AbpAccountAdminBlazorWebAssemblyModule),
typeof(AbpIdentityProBlazorWebAssemblyModule),
typeof(ChatBlazorWebAssemblyModule),
typeof(AbpOpenIddictProBlazorWebAssemblyModule),
typeof(AbpAuditLoggingBlazorWebAssemblyModule),
typeof(TextTemplateManagementBlazorWebAssemblyModule),
typeof(LanguageManagementBlazorWebAssemblyModule),
typeof(AbpSolution1HttpApiClientModule)
)]
public class AbpSolution1BlazorClientModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var environment = context.Services.GetSingletonInstance<IWebAssemblyHostEnvironment>();
var builder = context.Services.GetSingletonInstance<WebAssemblyHostBuilder>();
ConfigureLocalization();
ConfigureAuthentication(builder);
ConfigureHttpClient(context, environment);
ConfigureBlazorise(context);
ConfigureRouter(context);
ConfigureMenu(context);
ConfigureAutoMapper(context);
ConfigureTheme();
ConfigureToolbar();
}
private void ConfigureToolbar()
{
Configure<AbpToolbarOptions>(options =>
{
options.Contributors.Add(new MyToolbarContributor());
});
}
private void ConfigureLocalization()
{
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<AbpSolution1Resource>()
.AddBaseTypes(typeof(AbpUiResource));
});
}
private void ConfigureTheme()
{
Configure<LeptonXThemeOptions>(options =>
{
options.DefaultStyle = LeptonXStyleNames.System;
});
Configure<LeptonXThemeBlazorOptions>(options =>
{
// When this is changed, `AbpCli:Bundle:LeptonXTheme.Layout` parameter with value 'top-menu' should be added into appsettings.json,
// Then `abp bundle` command should be executed to apply the changes.
options.Layout = LeptonXBlazorLayouts.SideMenu;
});
}
private void ConfigureRouter(ServiceConfigurationContext context)
{
Configure<AbpRouterOptions>(options =>
{
options.AppAssembly = typeof(AbpSolution1BlazorClientModule).Assembly;
});
}
private void ConfigureMenu(ServiceConfigurationContext context)
{
Configure<AbpNavigationOptions>(options =>
{
options.MenuContributors.Add(new AbpSolution1MenuContributor(context.Services.GetConfiguration()));
});
}
private void ConfigureBlazorise(ServiceConfigurationContext context)
{
context.Services
.AddBootstrap5Providers()
.AddFontAwesomeIcons();
}
private static void ConfigureAuthentication(WebAssemblyHostBuilder builder)
{
builder.Services.AddOidcAuthentication(options =>
{
builder.Configuration.Bind("AuthServer", options.ProviderOptions);
options.UserOptions.NameClaim = OpenIddictConstants.Claims.Name;
options.UserOptions.RoleClaim = OpenIddictConstants.Claims.Role;
options.ProviderOptions.DefaultScopes.Add("AbpSolution1");
options.ProviderOptions.DefaultScopes.Add("roles");
options.ProviderOptions.DefaultScopes.Add("email");
options.ProviderOptions.DefaultScopes.Add("phone");
});
}
private static void ConfigureHttpClient(ServiceConfigurationContext context, IWebAssemblyHostEnvironment environment)
{
context.Services.AddTransient(sp => new HttpClient
{
BaseAddress = new Uri(environment.BaseAddress)
});
}
private void ConfigureAutoMapper(ServiceConfigurationContext context)
{
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<AbpSolution1BlazorClientModule>();
});
}
public override void PostConfigureServices(ServiceConfigurationContext context)
{
var msAuthenticationStateProvider = context.Services.FirstOrDefault(x => x.ServiceType == typeof(AuthenticationStateProvider));
if (msAuthenticationStateProvider is {ImplementationType: not null} &&
msAuthenticationStateProvider.ImplementationType.IsGenericType &&
msAuthenticationStateProvider.ImplementationType.GetGenericTypeDefinition() == typeof(WebAssemblyAuthenticationStateProvider<,,>))
{
var implementationType = typeof(RemoteAuthenticationService<,,>).MakeGenericType(
msAuthenticationStateProvider.ImplementationType.GenericTypeArguments[0],
msAuthenticationStateProvider.ImplementationType.GenericTypeArguments[1],
msAuthenticationStateProvider.ImplementationType.GenericTypeArguments[2]);
context.Services.Replace(ServiceDescriptor.Scoped(typeof(AuthenticationStateProvider), implementationType));
}
}
}
hi
Try to set the scope to your principal.
principal.SetScopes(your scopes array);
principal.SetResources(await GetResourcesAsync(context, principal.GetScopes()));
hi
Can you set your log level to Debug and reproduce the error then share the full logs?
Thanks.
public class Program
{
public async static Task<int> Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Async(c => c.Console())
.CreateLogger();
hi
we noticed that the create/edit screen for tenants does not show the labels.
What is the UI of the create/edit page? angular or mvc?
Can you share a demo template project to reproduce this?
liming.ma@volosoft.com
Thanks.
hi
the goal is to redirect to the custom URL by default when the user is not logged in, and show the login page of Abp only when the user writes the URL in the browser.
The angular using the https://github.com/manfredsteyer/angular-oauth2-oidc as oidc client.
It uses the standard oauth2 protocol to set the redirect url in the query string.
If you change the redirect url you may break the protocol.
the goal is to redirect to the custom URL by default when the user is not logged in
You can override the account/login page to challenge your SAML authentication.
hi
You can set different ConnectionStrings in different appsettings.json for the dev and test environments.
Did you set the tenant's ConnectionStrings info?
Can you share your code or steps to reproduce the problem?
Thanks
hi
Have you added the FormsHttpApiModule(Volo.Forms.HttpApi)
The https://localhost:44325/api/abp/api-definition endpoint should contain the form apis.
Thanks. I will check it asap.
hi
new Uri(configuration["AuthServer:Authority"]!
What is the value of AuthServer:Authority?
Please check it in your all src/Cincaporc.WebApp.AuthServer/appsettings.json(environment)
hi
Please share the code of your grant type.