Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Issues when creating a new External Authentication method #12216


User avatar
0
klir created

Hello,

I am working on setting up a custom external authentication and am following the guidance from this documentation: External Authentication - ASP.NET Boilerplate. However, I’ve encountered a few issues in the process:

1- In ExternalAuthManager.cs, within the CreateProviderApi method, my new custom authentication provider does not appear in the _externalAuthConfiguration.ExternalLoginInfoProviders list; 2- When authenticating via the standard form-based authentication, TryAuthenticateAsync is called on my custom external authentication, which is not the intended behavior; 3- I am looking for a way to implement a new external authentication flow using tokens (similar to OpenIdConnect) rather than a username/password. Specifically, I aim to authenticate using the ExternalAuthenticate endpoint in the TokenAuthController;

Any guidance or insights on resolving these issues would be greatly appreciated.

Here's the code I'm using for the test:


1 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi klir

    In order to define the custom provider you have added, you can define External Login in the ConfigureExternalAuthProviders method in *WebHostModule.cs. If you are using MVC, you can do this in *WebMvcModule.cs. This is the reason why it does not appear in ExternalLoginInfoProviders. If you want to use a tenant-based structure, you can define a class that will inherit TenantBasedExternalLoginInfoProviderBase.