hi
I think the ASP.NET Core only checks the BindProperty
of the base LoginModel
class.
hi
I have also created a PR to fix the overwriting of the Login Hint: https://github.com/abpframework/abp/pull/22887
Thanks. I will check it. : )
hi
[DisableAuditing]
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(LoginModel), typeof(OpenIddictSupportedLoginModel))]
public class MyCustomLogin : OpenIddictSupportedLoginModel
{
public MyCustomLogin(IAuthenticationSchemeProvider schemeProvider, IOptions<AbpAccountOptions> accountOptions, IAbpRecaptchaValidatorFactory recaptchaValidatorFactory, IAccountExternalProviderAppService accountExternalProviderAppService, ICurrentPrincipalAccessor currentPrincipalAccessor, IOptions<IdentityOptions> identityOptions, IOptionsSnapshot<reCAPTCHAOptions> reCaptchaOptions, AbpOpenIddictRequestHelper openIddictRequestHelper) : base(schemeProvider, accountOptions, recaptchaValidatorFactory, accountExternalProviderAppService, currentPrincipalAccessor, identityOptions, reCaptchaOptions, openIddictRequestHelper)
{
}
public override async Task<IActionResult> OnGetAsync()
{
var result = await base.OnGetAsync();
if (LoginInput.UserNameOrEmailAddress.IsNullOrWhiteSpace())
{
LoginInput.UserNameOrEmailAddress = Request.Query["TestUrlParameter"];
}
return result;
}
}
hi
I think you can add a middleware before or after Authorization
to do some custom logic.
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-9.0
If overriding OpenIddictSupportedLoginModel
still does not work. Can you share a test project?
liming.ma@volosoft.com
Thanks
hi
If you are using OpenIddict, you need to override the OpenIddictSupportedLoginModel
[ExposeServices(typeof(LoginModel), typeof(OpenIddictSupportedLoginModel))]
public class MyOpenIddictSupportedLoginModel : OpenIddictSupportedLoginModel
I have update the document.
https://github.com/abpframework/abp/pull/22770
ok, I will check your project.
hi
Can you share a minimal project to reproduce?
Thanks.
liming.ma@volosoft.com
hi
Please share full code of your CatOsHttpApiClientTestModule
It needs to depends on AbpHttpClientModule
hi
Generated proxy may have issues, you can try sending an HTTP request yourself.
By the way, you can test the HTTP request in Postman, then implement it in Angular.
Thanks.