- Steps to reproduce the issue: UPgraded project from 9.0.4 to 9.2.3 version of Volo. We had Helper override methods for class "ExternalProviderSettingsHelper". We need them to save tenant specific external login settings. GetByNameAsync(string name, bool fallBackToHost = false) and public override async Task SetAsync(List<ExternalProviderSettings> settings) not working now. Please help.
66 Answer(s)
-
0
Can we work with current DB by clearing few tables. That will be easy for us to debug.
The project is http://dev.approach.cpat.dev and http://cpattest.dev.approach.cpat.dev
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
hi
You can remove all settings of
Abp.Account.ExternalProviders,Then add them in your setting page again.After that, everything will work.
Because the template project is no problem.
Thanks.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Should I remove from table as well ? I removed the
Shared_TMSExternalProviderSettingsHelper : IExternalLoginProviderclass.Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
We have public class
CustomLoginModel : LoginModelin theAuth serverit is referring toExternalProviders. base class still needs ExternalProviders reference. Should I removeCustomLoginModelclass ?CustomLoginModelis referred inLogin.cshtmlDeleted table data and removed the Shared_TMSExternalProviderSettingsHelper class. I couldn't remove CustomLoginModel.cs due to existing dependencies, as mentioned earlier. The database records have now been cleaned and the Redis cache cleared. Result: -The tenant is no longer able to read external provider data. :-( -Host admin can read external provider data fine.
DB does NOT look right: Now the save is not working after clearing cache.

Select Save->switch to Audit Logs->Switch back to settings.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
hi
Can you test your case in a new template project?
The logic here are:
- If your tenant setting values are the same as the host, the tenant setting will be empty. But the external login feature will no problem.
- The host and the tenant can enable external login separately.
- Host: Enable/disable external logins and control which external logins can be used by tenants
- Tenant: Enable/disable the external login the host allows it to use.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
[maliming] said:
Where should I inject ExternalProviderSettingsHelper service ?
I emailed you the code of Shared_TMSExternalProviderSettingsHelper class. I deleted that class in the 9.2.3 upgrade project,
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
[maliming] said: hi
Can you test your case in a new template project?
The logic here are:
- If your tenant setting values are the same as the host, the tenant setting will be empty. But the external login feature will no problem.
- The host and the tenant can enable external login separately.
- Host: Enable/disable external logins and control which external logins can be used by tenants
- Tenant: Enable/disable the external login the host allows it to use.
Let me try this now.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
[sghorakavi@cpat.com] said:
[maliming] said: hi
Can you test your case in a new template project?
The logic here are:
- If your tenant setting values are the same as the host, the tenant setting will be empty. But the external login feature will no problem.
- The host and the tenant can enable external login separately.
- Host: Enable/disable external logins and control which external logins can be used by tenants
- Tenant: Enable/disable the external login the host allows it to use.
Let me try this now.
With template project, I have issue to login as tenant.:
-Logged in to host - Created external login separate option -- Created tenant -Login to tenant from host admin getting below error.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
-
0Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
-
0Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
-
0
hi
You need to remove your custom
Shared_TMSExternalProviderSettingsHelperand clear the setting value ofAbp.Account.ExternalProvidersThen upgrade to 9.3.x. Everything will work.
Thanks..
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
[maliming] said: hi
You need to remove your custom
Shared_TMSExternalProviderSettingsHelperand clear the setting value ofAbp.Account.ExternalProvidersThen upgrade to 9.3.x. Everything will work.
Thanks..
- I removed Shared_TMSExternalProviderSettingsHelper class,
- cleared tables. Reset data seed.
Note: We have a class
CustomLoginModel : LoginModel. This class has reference toVolo.Abp.Account.ExternalProviders.Injecting
IAccountExternalProviderAppServiceIt is
AuthServer\Pages\Account\CustomLoginModel.csLocation. How should I handle this class?Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
[maliming] said: liming.ma@volosoft.com
Sent you pls check
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
[maliming] said: hi
Your
CustomLoginModelwon't affect theExternalProviderSettingsHelper.You can continue to keep it.
Thanks.
In that case, http://dev.approach.cpat.dev has that code. // It gets SSO fine
Please check http://cpattest.dev.apprch.cpat.dev //Does not save SSO information for Extrernal Login
The code is not failing but NOT saving tenant specific external provider data:
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Added following in HostModule.cs
private static void ConfigureExternalProviders(ServiceConfigurationContext context){context.Services.AddDynamicExternalLoginProviderOptions<PingOneAuthenticationOptions>(PingOneAuthenticationDefaults.AuthenticationScheme,// (options, serviceProvider, tenantId) =>options =>{options.WithProperty(x => x.ClientId);options.WithProperty(x => x.ClientSecret, isSecret: true);options.WithProperty(x => x.AuthorizationEndpoint);options.WithProperty(x => x.TokenEndpoint);options.WithProperty(x => x.UserInformationEndpoint);}).AddDynamicExternalLoginProviderOptions<MicrosoftAccountOptions>(MicrosoftAccountDefaults.AuthenticationScheme,options =>{options.WithProperty(x => x.AuthorizationEndpoint);options.WithProperty(x => x.TokenEndpoint);options.WithProperty(x => x.ClientId);options.WithProperty(x => x.ClientSecret, isSecret: true);});}AuthServer Module has following for external login
context.Services.AddAuthentication().AddPingOne(options =>{// Common optionsoptions.SaveTokens = true;options.SignInScheme = IdentityConstants.ExternalScheme;options.EnvironmentId = "Dynamic";options.CallbackPath = "/signin-pingone";// read tenant specific data//scopeoptions.Scope.Add("openid");options.Scope.Add("profile");options.Scope.Add("offline_access");}).WithDynamicOptions<PingOneAuthenticationOptions, PingOneAuthenticationHandler>("PingOne",options =>{options.WithProperty(x => x.ClientId);options.WithProperty(x => x.ClientSecret, isSecret: true);options.WithProperty(x => x.AuthorizationEndpoint);options.WithProperty(x => x.TokenEndpoint);options.WithProperty(x => x.UserInformationEndpoint);}).AddMicrosoftAccount(MicrosoftAccountDefaults.AuthenticationScheme, options =>{//Personal Microsoft accounts as an example.options.AuthorizationEndpoint = "https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize";options.TokenEndpoint = "https://login.microsoftonline.com/consumers/oauth2/v2.0/token";options.ClaimActions.MapCustomJson("picture", _ => "https://graph.microsoft.com/v1.0/me/photo/$value");options.SaveTokens = true;}).WithDynamicOptions<MicrosoftAccountOptions, MicrosoftAccountHandler>(MicrosoftAccountDefaults.AuthenticationScheme,options =>{options.WithProperty(x => x.TokenEndpoint);options.WithProperty(x => x.AuthorizationEndpoint);options.WithProperty(x => x.ClientId);options.WithProperty(x => x.ClientSecret, isSecret: true);});I will try to create a sample but pls review code above. Is there a way to put some logs for you to debug ?
Thank you
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)









