Hello. I'm trying to enable social login buttons for Google and Facebook. I have registered my app and have my authentication keys in appsettings.json and set "IsEnabled": "true". But GetExternalAuthenticationProviders() in TokenAuthController returns 0.
I can see that ConfigureExternalAuthProviders() in GlobalOpinionsWebHostModule class is adding my providers to the list when the solution starts up.
So why can _externalAuthConfiguration.Providers in this code return 0?
[HttpGet] public List<ExternalLoginProviderInfoModel> GetExternalAuthenticationProviders() { return ObjectMapper.Map<List<ExternalLoginProviderInfoModel>>(_externalAuthConfiguration.Providers); }
Is there something I've forgotten? I'm using the Angular version.
26 Answer(s)
-
0
Hi @affern,
Thank you for finding the problem. You can create a new class and add it as the second parameter for <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/master/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Core/Controllers/TokenAuthController.cs#L342">https://github.com/aspnetzero/aspnet-ze ... er.cs#L342</a>.
You can also create a new method in UserRegistrationManager which gets your new parameters as well. It's code will be similar to existing RegisterAsync but you will set your new parmeters on user as you like.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)