angular, dotnetcore, 6.8.0 .net framework 4.6.1 I have a request from a tenant to lockdown the tenant login to an ip address or range of ip paddresses. When building a list of whitelisted IP's I would like the user to be able to get their local public IP (they have a fixed IP). The problem I have is with CORS and I am useless with CORS. The simplest call I have found is to create and inject a service in my angular component with this method:
getIpAddress() {
return this.http.get<{ ip: string }>('https://jsonip.com/');
}
That gives me this error:
Access to XMLHttpRequest at 'https://jsonip.com/' from origin 'http://localhost:4200' has been blocked by CORS policy: Request header field pragma is not allowed by Access-Control-Allow-Headers in preflight response.
I have added CORS origins to my appsettings.json in the dotnetcore solution as follows:
"CorsOrigins": "http://*.nuagecare.net,http://localhost:4200,http://localhost:49152,https://jsonip.com/",
I have googled as much as I can but reading about CORS for me is like trying to decipher the Rosetta Stone. Can anyone give me a hand? Note - eventually I will use ipstack.com so I can also get the lat/long to lockdown device usage but the above code gives the general idea.
angular, dotnetcore, 6.8.0 .net 4.6.1 A quick question. Does 6.8.0 implement Metronic 5.5.5? I have downloaded and built Metronic 5.5.5 and the UI implements a material interface I am unfamiliar with. I am running the Metronic version at:
Metronic\metronic_v5.5.5\metronic_v5.5.5\theme\angular\dist\demo\default
Am I missing something?
Hi @ryancq, yes that option is set. However I will take a closer look at this because I have not enabled Hangfire using abp.hangfire, I simply implemented Hangfire in the Core project using Nuget.
Hi @ryancq, understood, I took a look at the code. The user can enable Google Authentication regardless of whether the option is set. As soon as you set 2FA Google Authentication is enabled at the user level. Switching it off at the host level does not change this.
I am getting an error when selecting the "Download collected data problem" option on the user drop down:
System.InvalidOperationException: JobStorage.Current property value has not been initialized. You must set it before using Hangfire Client or Server API.
I have Hangfire enabled, Web.Host.StartUp:
if (WebConsts.HangfireDashboardEnabled)
{
//Hangfire dashboard &server(Enable to use Hangfire instead of default job manager)
app.UseHangfireDashboard(WebConsts.HangfireDashboardEndPoint, new DashboardOptions
{
Authorization = new[] { new AbpHangfireAuthorizationFilter(AppPermissions.Pages_Administration_HangfireDashboard) }
});
app.UseHangfireServer();
}
and Web.Core projectnameWebCoreModule:
//Uncomment this line to use Hangfire instead of default background job manager (remember also to uncomment related lines in Startup.cs file(s)).
Configuration.BackgroundJobs.UseHangfire();
The code firing the error is in the ProfileAppService:
public async Task PrepareCollectedData()
{
await _backgroundJobManager.EnqueueAsync<UserCollectedDataPrepareJob, UserIdentifier>(AbpSession.ToUserIdentifier());
}
I thought by implementing Hangfire the injection of backgroundJobManager would replace abp background manager with Hangfire?
Hi maliming, I presume I can wait for the 6.9.0 release after which it will be fixed? If that's the case just answer "yes" and close the post. Thanks very much for your help, always a pleasure.
Nope, none.
Thanks ryancyq, but I still don't know why users should have the Google Authenticator option if it has not been set?
In host User Management tab check "Phone number verification enabled (via SMS)". In host Security tab settings check "Enable two factor user login." under the heading Two Factor Login. Below this check "Enable SMS verification." In tenant Security tab check "Enable two factor user login.". For each user to use 2FA check "Two factor authentication enabled".