I am encountering the same issue running the application locally, outside of docker.
a) Navigate to url:
https://localhost:44309/Account/Login?ReturnUrl=https%3A%2F%2Flocalhost%3A44306%2Fsignin-oidc
b) Login :
c) Exception:
d) web public log file:
2022-06-07 14:37:48.835 -07:00 [INF] Error from RemoteAuthentication: OpenIdConnectAuthenticationHandler: message.State is null or empty.. 2022-06-07 14:37:48.836 -07:00 [ERR] An unhandled exception has occurred while executing the request. System.Exception: An error was encountered while handling the remote login. ---> System.Exception: OpenIdConnectAuthenticationHandler: message.State is null or empty. --- End of inner exception stack trace --- at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler`1.HandleRequestAsync() at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<
Upon logging into the Public Website (as result of a password reset or navigating to https://portal-identity-dev.com/Account/Login?returnUrl=https%3A%2F%2Fportal-web-public-dev.com%2Fsignin-oidc), the application returns to url ("https://portal-web-public-dev.com/signin-oidc") and a 500 Internal Server Error occurs:

In the public web server log:
2022-06-07 17:56:19.662 +00:00 [INF] Error from RemoteAuthentication: OpenIdConnectAuthenticationHandler: message.State is null or empty..
2022-06-07 17:56:19.663 +00:00 [ERR] An unhandled exception has occurred while executing the request.
System.Exception: An error was encountered while handling the remote login.
---> System.Exception: OpenIdConnectAuthenticationHandler: message.State is null or empty.
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler1.HandleRequestAsync() at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task) 2022-06-07 17:56:19.663 +00:00 [INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController.Index (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared)' 2022-06-07 17:56:19.663 +00:00 [INF] Route matched with {action = "Index", controller = "Error", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Microsoft.AspNetCore.Mvc.IActionResult] Index(Int32) on controller Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared).
2022-06-07 17:56:19.667 +00:00 [WRN] Could not find IdentityClientConfiguration for AbpMvcClient. Either define a configuration for AbpMvcClient or set a default configuration.
2022-06-07 17:56:19.667 +00:00 [INF] Start processing HTTP request GET "https://portal-api-dev.com/api/abp/application-configuration?api-version=1.0"
2022-06-07 17:56:19.667 +00:00 [INF] Sending HTTP request GET "https://portal-api-dev.com/api/abp/application-configuration?api-version=1.0"
2022-06-07 17:56:20.299 +00:00 [INF] Received HTTP response headers after 631.6003ms - 200
2022-06-07 17:56:20.299 +00:00 [INF] End processing HTTP request after 631.8429ms - 200
2022-06-07 17:56:20.436 +00:00 [INF] Executing ViewResult, running view ~/Views/Error/500.cshtml.
2022-06-07 17:56:20.452 +00:00 [WRN] Could not find IdentityClientConfiguration for CmsKitPublic. Either define a configuration for CmsKitPublic or set a default configuration.
2022-06-07 17:56:20.452 +00:00 [INF] Start processing HTTP request GET "https://portal-api-dev.com/api/cms-kit-public/menu-items?api-version=1.0"
2022-06-07 17:56:20.452 +00:00 [INF] Sending HTTP request GET "https://portal-api-dev.com/api/cms-kit-public/menu-items?api-version=1.0"
2022-06-07 17:56:20.485 +00:00 [INF] Received HTTP response headers after 33.3313ms - 200
2022-06-07 17:56:20.486 +00:00 [INF] End processing HTTP request after 33.559ms - 200
2022-06-07 17:56:20.491 +00:00 [INF] Executed ViewResult - view ~/Views/Error/500.cshtml executed in 54.2382ms.
Pressing the Login button navigates to the identity server and back again with a logged-in state.
I am using docker containers.
Identity server app settings: { "App": { "SelfUrl": "https://portal-identity-dev.com", "ClientUrl": "https://portal-web-public-dev.com", "CorsOrigins": "https://portal-app-dev.com,https://portal-api-dev.com,https://portal-identity-dev.com", "RedirectAllowedUrls": "https://portal-app-dev.com,https://portal-api-dev.com,https://portal-web-public-dev.com/signin-oidc" }, "AuthServer": { "Authority": "https://portal-identity-dev.com", "RequireHttpsMetadata": "false", "ValidIssuers": [ "https://portal-web-public-dev.com", "https://portal-app-dev.com", "https://portal-web-dev.com", "https://portal-api-dev.com" ] }, "ConnectionStrings": { "Default": "Server=XX\data1; Database=Portal; User=sa; Password=XX;" }, "Redis": { "Configuration": "redis" }, "StringEncryption": { "DefaultPassPhrase": "ZY4h7Pg08tNZWA0d" } }
Web Public appsettings: { "App": { "SelfUrl": "https://portal-web-dev.com" }, "RemoteServices": { "Default": { "BaseUrl": "https://portal-api-dev.com/" }, "AbpAccountPublic": { "BaseUrl": "https://portal-identity-dev.com/" } }, "Redis": { "Configuration": "redis" }, "AuthServer": { "Issuer": "https://portal-web-public.com", "Authority": "https://portal-identity-dev.com", "RequireHttpsMetadata": "true", "ClientId": "Portal_Web_Public_Tiered", "ClientSecret": "1q2w3e*", "ValidIssuers": [ "https://portal-web-public-dev.com", "https://portal-app-dev.com", "https://portal-web-dev.com", "https://portal-api-dev.com" ] }, "StringEncryption": { "DefaultPassPhrase": "ZY4h7Pg08tNZWA0d" } }
Hi
For our public website (MVC) project, the users should be directed to the dashboard after successfully logging in, instead of the default home page (index). We don't want them to always be redirected (as described here https://support.abp.io/QA/Questions/2011/Abp-Routing), just after the initial login. The user should be able to navigate to the home page after logging in without being redirected to the dashboard.
Can you please provide some assistance?
Thanks
This works - thanks!
hi
Can you direct share a template project with me? liming.ma@volosoft.com
I will check it locally.
sent shared link to your email. thx
To reiterate, I am adding an extra property on the User Personal Info tab for Communication Language, that can be set by the user. I have the property displaying on the view component but updating the value throws an error:
Your request is not valid! The following errors were detected during validation. - The field Language is invalid.
To replace the personal info tab, I did the following in the Identity Server project:
public class MyAccountProfileManagementPageContributor : IProfileManagementPageContributor
{
public async Task ConfigureAsync(ProfileManagementPageCreationContext context)
{
var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<AccountResource>>();
context.Groups.Remove(context.Groups.First(x => x.Id == "Volo-Abp-Account-PersonalInfo"));
context.Groups.Add(
new ProfileManagementPageGroup(
"Volo-Abp-Account-PersonalInfo",
l["ProfileTab:PersonalInfo"],
typeof(MyAccountProfilePersonalInfoManagementGroupViewComponent)
)
);
}
}
Configure<ProfileManagementPageOptions>(options =>
{
options.Contributors.Add(new MyAccountProfileManagementPageContributor());
});
public static void Configure()
{
OneTimeRunner.Run(() =>
{
ObjectExtensionManager.Instance
.AddOrUpdateProperty<ProfileDto, Language>(AccountExtensionProperties.Language)
.AddOrUpdateProperty<UpdateProfileDto, Language>(AccountExtensionProperties.Language)
.AddOrUpdateProperty<MyPersonalInfoModel, Language>(AccountExtensionProperties.Language);
});
}
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PortalIdentityDtoExtensions.Configure();
}
namespace Volo.Abp.Account.Public.Web.Pages.Account.Components.ProfileManagementGroup.PersonalInfo;
public class MyAccountProfilePersonalInfoManagementGroupViewComponent : AccountProfilePersonalInfoManagementGroupViewComponent
{
public MyAccountProfilePersonalInfoManagementGroupViewComponent(
IProfileAppService profileAppService): base(profileAppService)
{
}
public override async Task<IViewComponentResult> InvokeAsync()
{
var user = await ProfileAppService.GetAsync();
var model = ObjectMapper.Map<ProfileDto, MyPersonalInfoModel>(user);
return View("~/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml", model);
}
public class MyPersonalInfoModel : ExtensibleObject
{
[Required]
[DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxUserNameLength))]
[Display(Name = "DisplayName:UserName")]
public string UserName { get; set; }
[Required]
[DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxEmailLength))]
[Display(Name = "DisplayName:Email")]
public string Email { get; set; }
[DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxNameLength))]
[Display(Name = "DisplayName:Name")]
public string Name { get; set; }
[DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxSurnameLength))]
[Display(Name = "DisplayName:Surname")]
public string Surname { get; set; }
[DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))]
[Display(Name = "DisplayName:PhoneNumber")]
public string PhoneNumber { get; set; }
public bool PhoneNumberConfirmed { get; set; }
public bool EmailConfirmed { get; set; }
}
}
Added a Default.cshtml to reference MyPersonalInfoModel and added handling for extra properties:
(see \Volo.Abp.Account.Pro.Public.Web\Pages\Account\Components\ProfileManagementGroup\PersonalInfo\Default.cshtml for rest of page)

Added the auto mapper profile:
public class PortalIdentityServerAutoMapperProfile : Profile
{
public PortalIdentityServerAutoMapperProfile()
{
CreateMap<ProfileDto, MyAccountProfilePersonalInfoManagementGroupViewComponent.MyPersonalInfoModel>().MapExtraProperties();
CreateMap<IdentitySecurityLog, IdentitySecurityLogDto>(); // can remove 5.2-RC2 https://github.com/abpframework/abp/issues/12070
}
}
context.Services.AddAutoMapperObjectMapper<PortalIdentityServerModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<PortalIdentityServerAutoMapperProfile>(validate: true);
});
Appreciate your assistance.
Worked a charm!
Thanks so much.
For the Web.Public MVC Project, we require certain menu items are available/unavailable based on the state of the user. I think the right approach is to use DI to inject the interface for the application service I want to use to get the data.

However, I can't add the interface to the constructor of the MenuContributor class because it would be required in the module class itself:

I've read the dependency injection section of the guide and think that I should be using property injection but it's not clear to me how I can get an instance of the interface: https://docs.abp.io/en/abp/5.2/Dependency-Injection#property-injection
Can you please provide some guidance on how to achieve this?
Thanks
Hi @maliming
I'd prefer not to share, are you unable to reproduce the error?
Thanks Jamie
If you're creating a bug/problem report, please include followings:





I want the user to be able to update this field too and available in the Account personal info tab.
On the separate Identity server project, I attempted to override the AccountProfilePersonalInfoManagementGroupViewComponent by:




When I do all this I get the error above.
Can you please let me know the correct approach for extending the PersonalInfo model and UI and ensuring the user can update this property?
Thanks