Dear ASP Zero Support Team,
We are currently utilizing the ASP Zero framework Angular & ASP.NET CORE (currently version 12.0) . As part of this project, we need to deliver our solution in containers. Specifically, we have two containers (or is it just 1 ? Can we deploy in container only in one image?): one containing the Angular application and the other likely containing the ASP.NET Core component.
Our client has recommended using Trivy for pre-deployment security scans to check for malware and other security vulnerabilities. We would like to know if you have any recommendations or best practices for performing such security scans on solutions based on ASP Zero. Additionally, have you conducted similar scans on your codebase, and if so, could you share your general approach or any relevant documentation?
Your guidance on this matter would be greatly appreciated.
Thank you for your support.
Best regards,
Hi,
I get this error
Quartz.IServiceCollectionQuartzConfigurator.UseMicrosoftDependencyInjectionScopedJobFactory(System.Action`1<Quartz.JobFactoryOptions>)
here my code:
private void ConfigureElsa(IServiceCollection services) { services.AddElsa(elsa => { elsa .UseEntityFrameworkPersistence(ef => ef.UseSqlServer(_appConfiguration.GetConnectionString("Default")) ) .AddConsoleActivities() .AddHttpActivities(_appConfiguration.GetSection("Elsa").GetSection("Server").Bind) .AddEmailActivities(_appConfiguration.GetSection("Smtp").Bind) .AddQuartzTemporalActivities() .AddJavaScriptActivities() //.AddWorkflow
elsa.AddActivity<SendEmailActivity>();
elsa.UseAutoMapper(() => { });
}
);****
any idea how to fix?
Project type: Angular with ASP.NET core - Version 12.0
HI,
I needs to implement OAUTH with Microsoft Entra authentication SSO login - how could that be possible?
Thanks Oliver
When we deploy new codes, most of new features work fine but not for some changes. For example, if the front-end developers update the service connection and deploy it, users have to open incognito window or clear cache to see the new feature.
How could the ASPZERO Angular app has to clear cache after new deployment? Any ideas?
Angualr + aspnet core V12.
Hi,
my users whant to set userspecific start page when login - is it possible / how?
Thanks Oliver
Hi,
I pass tenantId from UI to API - the value of tenantId is correct - then I try to set using (CurrentUnitOfWork.SetTenantId(tenantId))
and request for a setting the value: var partnerNameFromDB = await SettingManager.GetSettingValueForTenantAsync(AppSettings.SAMLLoginManagement.PartnerName, AbpSession.GetTenantId());
But what I get as result is the setting from host (where TenandId in database is NULL)
Any idea - here my code:
[HttpGet] public async Task<IActionResult> InitiateMySingleSignOn(string returnUrl, int tenantId) { Logger.Info("returnUrl" + returnUrl + " - tenantId" + tenantId.ToString());
using (CurrentUnitOfWork.SetTenantId(tenantId))
{
try
{
var partnerNameFromDB = await SettingManager.GetSettingValueForTenantAsync(AppSettings.SAMLLoginManagement.PartnerName, AbpSession.GetTenantId());
Thanks
Usage: Angular + .NET core ASPZERO version 12x:
I needs to send messages to specific user of a specific tenant from console app. How could that work? below some proposal fromChatGTP
using Microsoft.AspNetCore.SignalR.Client; using System; using System.Threading.Tasks;
class Program { static async Task Main(string[] args) { // Configuration var apiUrl = "http://your-api-url"; var hubPath = "/yourHubPath"; var accessToken = "your-access-token"; // Obtain from your authentication mechanism
var hubConnection = new HubConnectionBuilder()
.WithUrl($"{apiUrl}{hubPath}", options =>
{
options.AccessTokenProvider = () => Task.FromResult(accessToken);
})
.Build();
// Handle connection events
hubConnection.Closed += async (error) =>
{
Console.WriteLine($"Connection closed. Reconnecting...");
await Task.Delay(new Random().Next(0, 5) * 1000);
await hubConnection.StartAsync();
};
// Start the connection
await hubConnection.StartAsync();
Console.WriteLine($"Connection started with connection ID: {hubConnection.ConnectionId}");
// Send a message to a specific user
await SendMessageToUser(hubConnection, "userId123", "Hello to specific user!");
// Close the connection when done
await hubConnection.StopAsync();
Console.WriteLine("Connection stopped.");
}
static async Task SendMessageToUser(HubConnection hubConnection, string userId, string message)
{
try
{
await hubConnection.InvokeAsync("SendMessageToUser", userId, message);
Console.WriteLine($"Message sent to user {userId}: {message}");
}
catch (Exception ex)
{
Console.WriteLine($"Error sending message: {ex.Message}");
}
}
}
Hi,
Version used: Angular & ASPNET core V12.1
I needs to setup (without using the appsettings.json) a scenario, that tenant is automatilly selected on login page based on subdomain in multi-tenant setup from incoming URL
Example https://tenant1.myURL.com -> tenant1 is selected on the login page
https://tenant2.myURL.com -> tenant2 is selected on the login page .........
How could that work?
thanks!
Hi,
I integrated costom .net Framework 4.8 project into *.Core.Shared - in my Framework 4.8 project I've multiple connection strings
To get it up and running - I needa to have these multiple connection strings in HOST project.
Could it be done like this?
json
"ConnectionStrings": { "DefaultConnection": "YourDefaultConnectionStringHere", "Database1Connection": "YourDatabase1ConnectionStringHere", "Database2Connection": "YourDatabase2ConnectionStringHere" }
Update ConfigureServices: Modify your ConfigureServices method to include the configuration for multiple connection strings. Below is an example of how you can do this:
csharp
public IServiceProvider ConfigureServices(IServiceCollection services) { // ... Existing code ...
// Register connection strings
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
services.AddDbContext<Database1Context>(options =>
options.UseSqlServer(Configuration.GetConnectionString("Database1Connection")));
services.AddDbContext<Database2Context>(options =>
options.UseSqlServer(Configuration.GetConnectionString("Database2Connection")));
// ... Existing code ...
}
In this example, I assumed that you're using Entity Framework Core for database access, and I've added ApplicationDbContext, Database1Context, and Database2Context as placeholders for your actual database contexts.
Using Connection Strings: Now you can inject these database contexts into your services or controllers and use them as needed. For example:
csharp
public class SomeService
{
private readonly ApplicationDbContext _dbContext;
private readonly Database1Context _db1Context;
private readonly Database2Context _db2Context;
public SomeService(ApplicationDbContext dbContext, Database1Context db1Context, Database2Context db2Context)
{
_dbContext = dbContext;
_db1Context = db1Context;
_db2Context = db2Context;
}
public void SomeMethod()
{
// Use _dbContext, _db1Context, and _db2Context here
}
}
By following these steps, you can use multiple connection strings in your ASP.NET Core application. Remember to replace placeholders like "YourDefaultConnectionStringHere", "YourDatabase1ConnectionStringHere", and "YourDatabase2ConnectionStringHere" with your actual connection strings. Additionally, make sure to adjust the context classes and database access code according to your application's architecture.
Hi,
we use Angular + net core - is it possible, additional to confirm a user account with mail, to add account confimation also with mobile phone and SMS possible? We build on top a native mobile app and want to add account confimation via mobile phone.
Thanks Oliver