Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "trendline"

I fixed it, the parameter transfer mode was wrong, after set the parameters as JSON object, it works now.

After upgrade to ABP 1.4.2, the Impersonate Sing In is failed, on the login page if selected or input the indicated tenant name, it can't been remembered and after login it doesn't go to the tenant admin panel. In the Host admin panel if do the impersonate action, it will throw up below exceptions:

An unhandled exception occurred while processing the request.

ApplicationException: Current tenant is different than given tenant. AbpSession.TenantId: , given tenantId: 4
Viewtance.SRP.Authorization.Impersonation.ImpersonationManager.CheckCurrentTenant(Nullable<int> tenantId) in ImpersonationManager.cs, line 100

Stack Query Cookies Headers
ApplicationException: Current tenant is different than given tenant. AbpSession.TenantId: , given tenantId: 4
Viewtance.SRP.Authorization.Impersonation.ImpersonationManager.CheckCurrentTenant(Nullable<int> tenantId) in ImpersonationManager.cs
+
        }
Viewtance.SRP.Authorization.Impersonation.ImpersonationManager+<GetImpersonatedUserAndIdentity>d__7.MoveNext() in ImpersonationManager.cs
+
            CheckCurrentTenant(cacheItem.TargetTenantId);
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Viewtance.SRP.Web.Controllers.AccountController+<ImpersonateSignIn>d__44.MoveNext() in AccountController.cs
+
            var result = await _impersonationManager.GetImpersonatedUserAndIdentity(tokenId, AuthConfigurer.AuthenticationScheme);

I am using Postman to demonstrate how the webapi works for non browser client. When running the GET methods it works fine, but when running the POST methods, it failed. it returns input is null, below is the return message:

{
  "result": null,
  "targetUrl": null,
  "success": false,
  "error": {
    "code": 0,
    "message": "Your request is not valid!",
    "details": "The following errors were detected during validation.\r\n - input is null!\r\n",
    "validationErrors": [
      {
        "message": "input is null!",
        "members": [
          "input"
        ]
      }
    ]
  },
  "unAuthorizedRequest": false,
  "__abp": true
}

I am using ABP 1.4.2 version, furthermore in debug mode in VS, the POST method cannot hit the break point, it seems the request been blocked by some filters, COSR? or DTO validation?

The IRepository interface defined some CURD method, such as Insert, Update, Delete......, all of them only accept a single entity parameter, why not provide the method which could accept a collection of entity?

So that, if we want to execute a bulk action, such as, update or delete, then we get a collection of the entity, via for each iterate the item and update it, at the last execute the _appRepository.Update(IList<entity> entities) do a database action.

Why not provide these extensions? Is the Unit Of Work attribute applied on a application service default done the work? So, the method of an application service is a transaction? after the method executed, a transaction is executing then all database action done together?

A sample code I did:

var results = from r in _resultRepository.GetAllList()
                                     .Where(r => r.EvaluationFormId == evaluationFormId)
                          select r;
            foreach (var item in results)
            {
                _resultService.ChangeStatus(item);
            }

but I want to do like below:

var results = from r in _resultRepository.GetAllList()
                                     .Where(r => r.EvaluationFormId == evaluationFormId)
                          select r;
            foreach (var item in results)
            {
                item.State = ResultStatus.Completed;
            }
           _resultService.Update(results);

As we know, aspnetzero asp.net core mvc editon already integrated Facebook, Google, Microsoft Account external authentication.

Is there a guide line that I can create an OAuth authentication mechanism to authenticate the AbpUser for other third-party app or website?

I know aspnetzero already provide the token based authentication, if I flow up the TokenAuthenticate method return an access-token out, does that works fine?

Answer

Sure, Thanks. I have found the code in MVC project.

Done, thanks.

Answer

Thanks @ismcagdas I have resolved my issues after checked <a class="postlink" href="https://aspnetzero.com/Documents/Development-Guide-Angular#ttoken-based-authentication">https://aspnetzero.com/Documents/Develo ... entication</a>, it is great that use Host website to provide API services, it is so cool.

"if the specified Abp.TenantId is configured as separated individual Database, it return internal server error" This issues mentioned before, because my separated individual Database for a tenant with an incorrect connection string , after correct the connection string it works fine now.

options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute())

I have checked the latest code from GitHub, this already removed, not existing in startup, right?

Thanks for your clarification, configured in appsettings.json is convenient for Host website, furthermore, Host website and Mvc website both with different domains. But we need to change it again after publish to server.

this tutorial maybe could help you <a class="postlink" href="https://docs.microsoft.com/en-us/aspnet/core/publishing/iis">https://docs.microsoft.com/en-us/aspnet ... ishing/iis</a>

Showing 111 to 120 of 154 entries