Activities of "Spospisil"

  • ABP Framework version: v4.4.0
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes

When producing source using ABP Suite, I run the DbMigrator and get the following error

[15:37:12 INF] Creating initial migration... [15:37:13 INF] ABP CLI (https://abp.io) [15:37:13 INF] Version 4.4.0 (Stable) [15:37:19 ERR] Migrations failed! A migration command didn't run successfully:

Build started... Build succeeded. More than one DbContext was found. Specify which one to use. Use the '-Context' parameter for PowerShell commands and the '--context' parameter for dotnet commands.

[15:37:19 ERR] Migrations failed! A migration command didn't run successfully:

Build started... Build succeeded. More than one DbContext was found. Specify which one to use. Use the '-Context' parameter for PowerShell commands and the '--context' parameter for dotnet commands.

System.Exception: Migrations failed! A migration command didn't run successfully:

Build started... Build succeeded. More than one DbContext was found. Specify which one to use. Use the '-Context' parameter for PowerShell commands and the '--context' parameter for dotnet commands.

at Volo.Abp.Cli.Commands.CreateMigrationAndRunMigratorCommand.ExecuteAsync(CommandLineArgs commandLineArgs) in D:\ci\Jenkins\workspace\abp-framework-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Commands\CreateMigrationAndRunMigratorCommand.cs:line 67 at Volo.Abp.Cli.CliService.RunInternalAsync(CommandLineArgs commandLineArgs) in D:\ci\Jenkins\workspace\abp-framework-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\CliService.cs:line 158 at Volo.Abp.Cli.CliService.RunAsync(String[] args) in D:\ci\Jenkins\workspace\abp-framework-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\CliService.cs:line 66

C:\Source Code\StructureWeb\src\StructureWeb.DbMigrator\bin\Debug\net5.0\StructureWeb.DbMigrator.exe (process 36876) exited with code 0. To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. Press any key to close this window . . .

How can I override the UI of the login page using Identity server/Blazor. There is an article in the community section however it appears to be based on a earlier version of ABP where the 'LoginModel' class is in a different namespace.

ABP Framework version:** v4.4 UI type**: Blazor DB provider**: EF Core Identity Server Separated: yes

Hi,

I'm assuming you have created the Account folder in the Pages folder of the MyProjectName.IdentityServer project :)

CustomLoginModel.cshtml in Account folder

    [Dependency(ReplaceServices = true)] 
    [ExposeServices(typeof(LoginModel))] 
    public class CustomLoginModel : LoginModel 
    { 
        public CustomLoginModel( 
            IAuthenticationSchemeProvider schemeProvider,  
            IOptions<AbpAccountOptions> accountOptions,  
            IAbpRecaptchaValidatorFactory recaptchaValidatorFactory,  
            IAccountExternalProviderAppService accountExternalProviderAppService,  
            ICurrentPrincipalAccessor currentPrincipalAccessor,  
            IOptions<IdentityOptions> identityOptions,  
            IOptionsSnapshot<reCAPTCHAOptions> reCaptchaOptions) :  
            base(schemeProvider,  
                accountOptions,  
                recaptchaValidatorFactory,  
                accountExternalProviderAppService,  
                currentPrincipalAccessor,  
                identityOptions,  
                reCaptchaOptions) 
        { 
            Console.WriteLine("Test QA Question"); 
        } 
    } 

Please let us know if it works after you try it.

I'm a little confused by your response as you mentioned that this should be done in the cshtml file not the class. Could you list exactly what I need to do in order to do this as I've seend some conflicting information in the documentation.

Thanks

Hi,

I'm assuming you have created the Account folder in the Pages folder of the MyProjectName.IdentityServer project :)

CustomLoginModel.cshtml in Account folder

    [Dependency(ReplaceServices = true)]  
    [ExposeServices(typeof(LoginModel))]  
    public class CustomLoginModel : LoginModel  
    {  
        public CustomLoginModel(  
            IAuthenticationSchemeProvider schemeProvider,   
            IOptions<AbpAccountOptions> accountOptions,   
            IAbpRecaptchaValidatorFactory recaptchaValidatorFactory,   
            IAccountExternalProviderAppService accountExternalProviderAppService,   
            ICurrentPrincipalAccessor currentPrincipalAccessor,   
            IOptions<IdentityOptions> identityOptions,   
            IOptionsSnapshot<reCAPTCHAOptions> reCaptchaOptions) :   
            base(schemeProvider,   
                accountOptions,   
                recaptchaValidatorFactory,   
                accountExternalProviderAppService,   
                currentPrincipalAccessor,   
                identityOptions,   
                reCaptchaOptions)  
        {  
            Console.WriteLine("Test QA Question");  
        }  
    }  

Please let us know if it works after you try it.

I'm a little confused by your response as you mentioned that this should be done in the cshtml file not the class. Could you list exactly what I need to do in order to do this as I've seend some conflicting information in the documentation.

Thanks

To be more specific I want to override the look of of the login page, meaning I don't want the tennant selector and I also want to add/remove items in the login box and do custom code (calling different services) behind the various button clicks.

  • ABP Framework version: v4.4.0
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

I have an ABP project that has the Identity Server project seperated but what I would like to do is to have the tables that it creates residing in a seperate database from all the other ABP tables that get created during the initial migration. I want no other ABP tables in this same database and I would also like to change the default prefix of the table that get created for Identity Server. How can this be done?

Question

ABP Framework version: v4.4.0 UI type: Blazor DB provider: EF Core Tiered (MVC) or Identity Server Separated (Angular): yes Exception message and stack trace: Steps to reproduce the issue:"

I would like to override the existing layout of the stock theme that comes with ABP. In other words I want to have multiple base layouts that I can set programitically for certain pages, etc. How can this be accomplished?

Question

ABP Framework version: v4.4.0 UI type: Blazor DB provider: EF Core Tiered (MVC) or Identity Server Separated (Angular): yes Exception message and stack trace: Steps to reproduce the issue:"

Is there a comprehensive open source or feature rich application (like an ecommerce site) showcasing real world scenarios using ABP? What I'm having a hard time figuring out is how to do the most basic standard web application tasks using ABP and a real-world sample application would be beneficial as a reference for further investigation.

Thanks for this. I notice though that the Blazor application does not run. I followed all the steps as outlined in the 'Server Side / MVC' section prior to trying to run the Blazor application and the Blazor app just gives me the spinner in the center of the page as shown in the attachment.

  • ABP Framework version: v4.4.0
  • UI type:MVC
  • DB provider: EF Core / PostgreSQL
  • Tiered (MVC) or Identity Server Separated (Angular): yes

I get the following error then trying to render a login page. Stack trace and Login.cshtml code is below

An unhandled exception occurred while processing the request.
DependencyResolutionException: None of the constructors found with 'Volo.Abp.Autofac.AbpAutofacConstructorFinder' on type 'Castle.Proxies.IdentityUserManagerProxy' can be invoked with the available services and parameters:
Cannot resolve parameter 'Volo.Abp.Identity.IIdentityRoleRepository roleRepository' of constructor 'Void .ctor(Castle.DynamicProxy.IInterceptor[], Volo.Abp.Identity.IdentityUserStore, Volo.Abp.Identity.IIdentityRoleRepository, Volo.Abp.Identity.IIdentityUserRepository, Microsoft.Extensions.Options.IOptions`1[Microsoft.AspNetCore.Identity.IdentityOptions], Microsoft.AspNetCore.Identity.IPasswordHasher`1[Volo.Abp.Identity.IdentityUser], System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Identity.IUserValidator`1[Volo.Abp.Identity.IdentityUser]], System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Identity.IPasswordValidator`1[Volo.Abp.Identity.IdentityUser]], Microsoft.AspNetCore.Identity.ILookupNormalizer, Microsoft.AspNetCore.Identity.IdentityErrorDescriber, System.IServiceProvider, Microsoft.Extensions.Logging.ILogger`1[Volo.Abp.Identity.IdentityUserManager], Volo.Abp.Threading.ICancellationTokenProvider, Volo.Abp.Identity.IOrganizationUnitRepository, Volo.Abp.Settings.ISettingProvider)'.
Autofac.Core.Activators.Reflection.ReflectionActivator.GetAllBindings(ConstructorBinder[] availableConstructors, IComponentContext context, IEnumerable&lt;Parameter&gt; parameters)

DependencyResolutionException: An exception was thrown while activating Volo.Abp.Account.Web.Pages.Account.IdentityServerSupportedLoginModel -> Volo.Abp.Identity.AspNetCore.AbpSignInManager -> Castle.Proxies.IdentityUserManagerProxy.
Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action&lt;ResolveRequestContext&gt; next)
  • Login.cshtml
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@using ABPWeb.Localization
@model Volo.Abp.Account.Public.Web.Pages.Account.LoginModel
@inject IHtmlLocalizer&lt;AccountResource&gt; L
@inject IHtmlLocalizer&lt;ABPWebResource&gt; LE
@inject Volo.Abp.AspNetCore.Mvc.UI.Layout.IPageLayout PageLayout
@{
    PageLayout.Content.Title = L["Login"].Value;
}

@section styles{
    &lt;abp-style src=&quot;/Pages/Account/Login.css&quot; /&gt;
}

&lt;div class=&quot;account-module-form&quot;&gt;
    @if (Model.EnableLocalLogin)
    {
        &lt;form method=&quot;post&quot;&gt;
            &lt;input asp-for=&quot;ReturnUrl&quot;/&gt;
            &lt;input asp-for=&quot;ReturnUrlHash&quot;/&gt;
            
            &lt;abp-input asp-for=&quot;LoginInput.UserNameOrEmailAddress&quot; required-symbol=&quot;false&quot;/&gt;
            &lt;small id=&quot;username-info&quot;&gt;@LE["UsernameInfo"]&lt;/small&gt;
            
            &lt;abp-input asp-for=&quot;LoginInput.Password&quot; required-symbol=&quot;false&quot;/&gt;
            &lt;small id=&quot;password-info&quot;&gt;@LE["PasswordInfo"]&lt;/small&gt;
            
            &lt;abp-row&gt;
                &lt;abp-column&gt;
                    &lt;abp-input asp-for=&quot;LoginInput.RememberMe&quot; class=&quot;mb-4&quot;/&gt;
                &lt;/abp-column&gt;
                &lt;abp-column class=&quot;text-right&quot;&gt;
                    &lt;a href=&quot;@Url.Page(&quot;./ForgotPassword&quot;, new { returnUrl = Model.ReturnUrl, returnUrlHash = Model.ReturnUrlHash })&quot;&gt;@L["ForgotPassword"]&lt;/a&gt;
                &lt;/abp-column&gt;
            &lt;/abp-row&gt;
            &lt;abp-button button-type=&quot;Primary&quot; size=&quot;Block&quot; type=&quot;submit&quot; class=&quot;mt-2 mb-3&quot; name=&quot;Action&quot; value=&quot;Login&quot;&gt;@L["Login"]&lt;/abp-button&gt;
            @if (Model.ShowCancelButton)
            {
                &lt;abp-button button-type=&quot;Secondary&quot; size=&quot;Block&quot; type=&quot;submit&quot; formnovalidate=&quot;formnovalidate&quot; class=&quot;mt-2 mb-3&quot; name=&quot;Action&quot; value=&quot;Cancel&quot;&gt;@L["Cancel"]&lt;/abp-button&gt;
            }
        &lt;/form&gt;
        @if (Model.IsSelfRegistrationEnabled)
        {
            @L["NotAMemberYet"]
            &lt;a href=&quot;@Url.Page(&quot;./Register&quot;, new {returnUrl = Model.ReturnUrl, returnUrlHash = Model.ReturnUrlHash})&quot;&gt;@L["Register"]&lt;/a&gt;
        }
    }

    @if (Model.VisibleExternalProviders.Any())
    {
        &lt;hr/&gt;
        @L["OrSignInWith"]&lt;br/&gt;
        &lt;form asp-page=&quot;./Login&quot; asp-page-handler=&quot;ExternalLogin&quot; asp-route-returnUrl=&quot;@Model.ReturnUrl&quot; asp-route-returnUrlHash=&quot;@Model.ReturnUrlHash&quot; method=&quot;post&quot;&gt;
            &lt;input asp-for=&quot;ReturnUrl&quot;/&gt;
            &lt;input asp-for=&quot;ReturnUrlHash&quot;/&gt;
            @foreach (var provider in Model.VisibleExternalProviders)
            {
                &lt;button
                    type=&quot;submit&quot;
                    class=&quot;mt-2 mr-2 btn btn-outline-primary btn-sm&quot;
                    name=&quot;provider&quot;
                    value=&quot;@provider.AuthenticationScheme&quot;
                    data-busy-text=&quot;@L[&quot;ProcessingWithThreeDot&quot;]&quot;&gt;
                    @if (provider.Icon != null)
                    {
                        &lt;i class=&quot;@provider.Icon&quot;&gt;&lt;/i&gt; 
                    }
                    &lt;span&gt;@provider.DisplayName&lt;/span&gt;
                &lt;/button&gt;
            }
        &lt;/form&gt;
    }

    @if (!Model.EnableLocalLogin && !Model.VisibleExternalProviders.Any())
    {
        &lt;div class=&quot;alert alert-warning&quot;&gt;
            &lt;strong&gt;Invalid login request&lt;/strong&gt;
            There are no login schemes configured for this client.
        &lt;/div&gt;
    }
&lt;/div&gt;

There is no login.cshtml.cs file. The Login* page I am using just for this sample is from the Volo.EasyCrm.Web project.

Showing 1 to 10 of 245 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11