Can you help solve the issue
My server i see the for web and APIhost that scope as profie,email etc and MyprojectName - which i believe acts as the scope for complete project resources(apis,pages etc).
Now i have two questions: 1. How can i create a scope for certain resources like to a specific controller 2. I have a machine to server communication, where i dont have userlogged in and i need to handle the secure api communication/authorization based on the machine identity. How can i user openid/autheserver to handle this scenario in abp.
Should i take three different certiifcate like *.apimyproduct.com , *.authmyproduct.com etc.
Can you help us what should be the preffered way to host the applications in the multi tenant context.
This is in UserDirectoryService in application layer
public virtual async Task<ADBaseResponse> ImportUsersAsync(ADUserObjectInputArgs input)
{
//Enqueue job with delay and priority
if(input.TenantId == null)
{
input.TenantId = this.CurrentTenant.Id;
}
await _backgroundJobManager.EnqueueAsync<ADUserObjectInputArgs>(input, BackgroundJobPriority.Normal);
return new ADBaseResponse() { Status = true, Message = "Users Syncing Initiated" };
}
**Backgroundjob: which is in domain layer**
[DisallowConcurrentExecution]
public class ADUsersManualSyncJob : AsyncBackgroundJob<ADUserObjectInputArgs>, ITransientDependency
{
//private readonly ICancellationTokenProvider _cancellationTokenProvider;
protected UserDirectoryManager UserDirectoryManager;
protected UserDirectoryFilterManager UserDirectoryFilterManager;
private readonly ADManagerService ADManagerServices;
protected UserManagementService UserManagementServices;
public ADUsersManualSyncJob(
//ICancellationTokenProvider cancellationTokenProvider,
UserDirectoryManager userDirectoryManager,
UserDirectoryFilterManager userDirectoryFilterManager, ADManagerService aDManagerService, UserManagementService userManagementServices
)
{
//_cancellationTokenProvider = cancellationTokenProvider;
UserDirectoryManager = userDirectoryManager;
UserDirectoryFilterManager = userDirectoryFilterManager;
ADManagerServices = aDManagerService;
UserManagementServices = userManagementServices;
}
[UnitOfWork]
public override async Task ExecuteAsync(ADUserObjectInputArgs args)
{
//_cancellationTokenProvider.Token.ThrowIfCancellationRequested();
var directoryServiceData = await UserDirectoryManager.GetDirectoryById(args.DirectoryId);
if (directoryServiceData != null)
{
var resp = await ProcessAsync(userData, args.TenantId, userInfo.UserAttributes); // code omitted for brevity
if(resp == null)
{
//TODO...
}var
}
}
private async Task<IdentityUser> ProcessAsync(CreateUserorUpdateInput input, Guid? tenantId, IDictionary<string, string> additionalAttributes)
{
//TODO...
var userInfo = await UserManagementServices.CreateUserAsync(input, tenantId, additionalAttributes);
return userInfo;
// need to call the create user function to onboard the user from Usermanagement Services...
}
**this is the create user function which is in user management service manager which is in domain layer**
************************************************************************************************************************************************
public class UserManagementService : ITransientDependency
{
protected IdentityUserManager _userManager { get; }
private readonly IIdentityRoleRepository RoleRepository;
private readonly IIdentityUserRepository _xSenseIdentityUserRepository;
protected UserDirectoryManager _userDirectoryManager { get; }
protected IOptions<IdentityOptions> IdentityOptions { get; }
public UserManagementService(IdentityUserManager userManager, IIdentityRoleRepository roleRepository, UserDirectoryManager userDirectoryManager,
IIdentityUserRepository xSenseIdentityUserRepository)
{
_userDirectoryManager = userDirectoryManager;
_userManager = userManager;
RoleRepository = roleRepository;
_xSenseIdentityUserRepository = xSenseIdentityUserRepository;
}
public bool CanCreateUserAsync(Guid? input)
{
try
{
return true;
}
catch (Exception ex)
{
return false;
}
}
[UnitOfWork]
public async Task<IdentityUser> CreateUserAsync(CreateUserorUpdateInput input,Guid? tenantId,IDictionary<string,string> additionalAttributes = null)
{
try
{
if(CanCreateUserAsync(tenantId))
{
var user = new IdentityUser(
input.Id,
input.UserName,
input.Email,
tenantId)
{
IsExternal = true,
Surname = input.Surname,
Name = input.Name
};
user.SetIsActive(true);
user.SetPhoneNumber(input.PhoneNumber, false);
user.SetEmailConfirmed(input.EmailConfirmed);
user.SetPhoneNumberConfirmed(input.PhoneNumberConfirmed);
user.SetDirectoryId(input.DirectoryId);
var dirObj = await _userDirectoryManager.GetDirectoryById(input.DirectoryId);
user.SetDirectoryName(dirObj.Name);
user.SetDirectoryType(dirObj.Type);
input.MapExtraPropertiesTo(user);
if(input.Password == null)
{
input.Password = user.Id.ToString();
}
var roleeNames = RoleRepository.GetListAsync().Result.Where(r => r.IsDefault == true).Select(r => r.Name).ToArray();
foreach (var item in additionalAttributes)
{
user.SetExtraProperties(item.Key, item.Value);
}
user.SetExtraProperties("FilterId", input.FilterId.ToString());
if(user != null)
{
var userResp = await _xSenseIdentityUserRepository.InsertAsync(user);~~~~
return userResp;
}
else
{
return null;
}
}
else
{
return null;
}
}
catch (Exception ex)
{
return null;
}
}
}
Now the issue is, users are not getting created in database, even though i dont see any excption in the entire flow.
One more observation is the same code is working in a different machine. I want to understand what could be the issue.
Altough i have used Quartz for background job implementation, i have also have rabbitmq settings in the appsettings but have an issue connecting to rabbitmqserver . Hope that wont be an issue.
After that when i try to go to my project and try /documents im navigating to homepage
While my expectation is to see abp docs
Check the samples to see the basic tasks: https://abp.io/docs/latest/samples
The exact solution to your question may have been answered before, and please first use the search on the homepage.
Provide us with the following info:
🧐 Hint: If you are using the ABP Studio, you can see all the information about your solution from the configuration window, which opens when you right-click on the solution and click on the Solution Configuration
button.
Check the docs before asking a question: https://abp.io/docs/latest
[15:46:52 ERR] Error converting value {null} to type 'System.Int32'. Path 'Properties[2].EnumValues.Individual', line 69, position 26.
Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.Int32'. Path 'Properties[2].EnumValues.Individual', line 69, position 26.
---> System.InvalidCastException: Null object cannot be converted to a value type.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
--- End of inner exception stack trace ---
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(TextReader reader, Type objectType)
at Volo.Abp.Suite.Services.PersistanceService.xgJr3Tcf2f(String )
at System.Linq.Enumerable.SelectIPartitionIterator2.MoveNext() at System.Collections.Generic.List
1.AddRange(IEnumerable1 collection) at Volo.Abp.Suite.Services.PersistanceService.GetEntitiesAsync(Guid solutionId) at Volo.Abp.Suite.Controllers.CrudPageGeneratorController.GetEntitiesAsync(Guid solutionId) at lambda_method1946(Closure, Object) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask
1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
Steps to reproduce the issue:
Im having a abp project and when im trying to open the solution in in ABP Suite, Im getting the above error.
I have updated the cli to 8.0.0., but still the same error.
We have created few entities without using suite, and application is building and working fine. Is it an issue because of the manual creation of the entities ?
*** Jquery validation version is showing 1.17.0 , but we have got a security scan report which wants us to update to 1.19.5 for security patch
*** I want your help in upgrading the version asap. Thanks.
ABP Framework version: v3.0.0
UI Type: MVC
Database System: EF Core (SQL Server)
Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
Exception message and full stack trace:
Steps to reproduce the issue:
Im seeing administrator, settings in the error screen side menu, which i dont want.
How do i overide so that i only show status code.