Hi Abp Zero Support,
Our project is Angular 8 + Core 2. I turned on Configuration.Auditing.SaveReturnValues = true; in ProjectCoreModule.PreInitialize().
And here are all customization I've done, in which ILoggedServices is an interface to turn on custom logging for some domain services.
Configuration.ReplaceService<IAuditingHelper, AuditingHelperExtension>();
Configuration.Auditing.IsEnabledForAnonymousUsers = true;
Configuration.Auditing.SaveReturnValues = true;
Configuration.Auditing.Selectors.Add(
new NamedTypeSelector(
"ILoggedServices",
type => typeof(ILoggedServices).IsAssignableFrom(type)
)
);
Btw, I added some custom interceptors as well:
Configuration.IocManager.IocContainer.Register(
Component.For<IOfferServiceIntegration>().ImplementedBy<OfferServiceIntegration>()
.Interceptors<OfferServiceInterceptor>()
.LifestyleTransient()
);
Then I ran unit tests, and saw Return Values are properly logged. But when I ran from swagger or frontend, Return Values are always null. Do I miss anything?
Thank you,
Hi Support,
I was trying to add an OrganizationUnitType column to AbpOrganizationUnits table, I created OrganizationUnitExtension class inherited from OrganizationUnit:
public class OrganizationUnitExtension : OrganizationUnit
{
public short OrganizationUnitTypeId { get; set; }
public OrganizationUnitExtension(int? tenantId, string displayName, short organizationUnitTypeId, long? parentId = null) : base(tenantId, displayName, parentId)
{
OrganizationUnitTypeId = organizationUnitTypeId;
}
}
And add following line to PostInitialize method of the CoreModule.cs:
Configuration.ReplaceService<OrganizationUnit, OrganizationUnitExtension>(DependencyLifeStyle.Transient);
but seems the there are a lot more dependencies on this table, no matter input/output dtos or dataset.
Is there a better way to modify the table? Could we use RAD tool?
Thank you,
Browser console shows that GET https://api.alservices.com/AbpUserConfiguration/GetAll?d=1567102056688 call fails with net::ERR_FAILED
network tab
Environment
ASP.NET Core Angular v7.1.0 .Net Core 2.2 Windows 10 Chrome Version 76.0.3809.100 (Official Build) (64-bit) Node v10.15.0 IIS 10.0.17134.1
Host appsettings.json
"App": {
"ServerRootAddress": "https://api.alservices.com/",
"ClientRootAddress": "http://{TENANCY_NAME}.alservices.com:81/",
"CorsOrigins":http://alservices.com:81,http://localhost:49152,
http://*.alservices.com:81",
"SwaggerEndPoint": "/swagger/v1/swagger.json",
"AllowAnonymousSignalRConnection": "true"
},
Observations
No errors are present in host log files, AbpUserConfiguration/GetAll executes successfully.
Question
Hello,
We are using a Multitenancy form of ABP.
We have added new features to ABPFeatures.cs:
public const string JobFeature = "App.Jobs"; public const string OfferFeature = "App.Jobs.Offer";
And we added this block to ABPFeatureProvider.cs
var JobFeature = context.Create( AppFeatures.JobFeature, scope: FeatureScopes.Tenant, defaultValue: "false", displayName: L("JobFeature"), inputType: new CheckboxInputType() );
JobFeature.CreateChildFeature( AppFeatures.OfferFeature, scope: FeatureScopes.Tenant, defaultValue: "false", displayName: L("OfferFeature"), inputType: new CheckboxInputType() );
After running the App locally, I do not see the Features in AbpFeatures table.
Also, how do we associate a Feature with an Edition via C#?
Thanks.
I am trying to get Current Tenant Name Or AbpSession in Constructor without parameter injection.
Working Code: public class CommonAllService : AppServiceBase { public IIMEIInformation _iMEIInformation { protected get; set; } private readonly IConfigurationRoot _configAccessor; private string _tenancyName; private readonly IAbpSession _session; public CommonAllService(IConfigurationRoot configAccessor,IAbpSession session) { _configAccessor = configAccessor; _session = session; _iMEIInformation = TenantDepedencyResolver.Resolve(_tenancyName); } public async Task GetDeviceInfo(GetIMEIRequest getImeiRequest) { return await _iMEIInformation.GetIMEIInformation(getImeiRequest); } }
we are Looking to get TenancyName or AbpSession without injecting in constructor? public class CommonAllService : AppServiceBase { public CommonAllService(IConfigurationRoot configAccessor) { _configAccessor = configAccessor; //Coming as Null var session = AbpSession.TenantId(); //Throwing abpexception GetCurrentTenant() its null var abc = GetCurrentTenant().TenancyName; _iMEIInformation = TenantDepedencyResolver.Resolve(_tenancyName); } }
Hi Abp Heros,
We have two different abp zero applications (one M5J1, and the other C2A7) using the same backend databases and sharing same users.
We were trying to call app2's API method from app1, but app2 requires authentication as well. Is it possible to use the authentication token generated from app1 to authenticate the user to call app2's API method?
Thank you
I am not able to use UserFriendlyException from Account controller it doesnt give me expected pop up message Please help
Can you provide guidance on a code deployment pipeline for aspnet core + angular?
I noticed you can run the build-with-ng.ps1 and build-mvc.ps1.
How does this fit into the pipeline?
Here is an example from a non-ABP project:
<a class="postlink" href="https://offering.solutions/blog/articles/2018/03/08/create-build-pipeline-for-angular-and-aspnetcore-app-with-visual-studio-team-services/">https://offering.solutions/blog/article ... -services/</a>
Our project is based on M5AJ1. We created a HttpPost method under a class that inherits AppServiceBase in Application project (so it is hosted on Owin). We could see and use the HttpPost method in swagger now.
The current issue is that I'm not able to retrieve the HttpHeader as there is no HttpContext or Request object in AppServiceBase, which is not implementing ApiController or IHttpController. I'm not able to inherit ApiController as I'm already inheriting AppServiceBase.
Just wondering how could I get request header information for this HttpPost method?
Thank you,
We're using MVC5.* + AJ1.*. In StartUp, we are using CookieAuthentication. I set the expireTimeSpan to 1 minute for testing purpose.
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
SlidingExpiration = true,
ExpireTimeSpan = TimeSpan.FromMinutes(1)
});
The issue is that when a user's cookie gets expired, the application throws the error of AntiForgery.AbpAntiForgeryApiFilter - Empty or invalid anti forgery header token.., and the page was not re-direct to the login page as expected.
And after that, if the user log in again, he will get cookie with expiration time of 1969-12-31T23:59:59.000Z, which in effect makes the cookie never expire -- causing that user never get automatically logged out. [attachment=0:334icsui]InfiniteExpirationDate.jpg[/attachment:334icsui]
Is there a way to log user out when the ApplicaionCookie gets expired rather than throw an error? I tried to use abp.session.userId, but the value is always not null.