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

Activities of "sago"

Answer

thank you , i have solved the problem

Answer

Hi, when i tried to change culture at appserviceBase using this line

Thread.CurrentThread.CurrentUICulture.DateTimeFormat = new CultureInfo("en-US").DateTimeFormat;

It raised System.InvalidOperationException: 'Instance is read-only.'

Run the below commands and check

npm install -g increase-memory-limit

Run from the root location of your project: increase-memory-limit

<cite>aaron: </cite> Show error in Logs.txt.

The Issue was not related to the Attribute AbpAuthorize, the issue we had is now resolved.

Thanks for you support !

<cite>ismcagdas: </cite> @sago we need to see your code to understand the problem. Because services in AspNet Zero don't have such a problem.

Issue resolved adding { provide: HTTP_INTERCEPTORS, useClass: AbpHttpInterceptor, multi: true } inside module, Thanks for your support !

<cite>ismcagdas: </cite> @sago we need to see your code to understand the problem. Because services in AspNet Zero don't have such a problem.

I Agree with Abp.AspNetCore v 2.3.0 and Angular 4 everything is working fine with me. The AbpSession Null issue I am faccing after migrating to Angular v 5.2.9. I will share the code and update you, also appreciate If you guide me to any appropriate documentation for this Angular Upgradtion.

Thanks,

<cite>ismcagdas: </cite> Hi @sago,

after navigating from this class to other custom service

Can you explain this ? I couldn't understand it.

It will be great if you can share your server-side and client-side code as well.

Okay ! I logged in to the application using admin privilleges, In the debug mode In UserAppService I can see all Session values, this class is decorated with attribute [AbpAuthorize()], when I navigate to the MyAppService the attribute [AbpAuthorize()] becomes InValid some how as it will not enter the requested method (decorated with attribute AbpAuthorize) and Session values are Null. This MyAppService is Inhierted from same base class ApplicationService. Again when I navigate to the UserAppService its Authorized and everything seems fine. I have problem with new created Services.

<cite>ismcagdas: </cite> Hi @sago,

Can you share your related code ?

This is where the user is Authorized and gets all service list from database..

[AbpAuthorize()] public async Task<List<UserNavigationHierarchyDto>> GetUserNavigationHierarchy(long UserId) { var vmUserNavigationHierarchy = await _sysobjectCustomRepo.GetUserNavigationHierarchy(UserId);

        List&lt;UserNavigationHierarchyDto&gt; results = new List&lt;UserNavigationHierarchyDto&gt;();
        foreach (var vm in vmUserNavigationHierarchy)
        {
            results.Add(new UserNavigationHierarchyDto
            {
                Id = vm.Id,
                Name = vm.JsonName,
                ParentId = vm.ParentId,
                Code = vm.Code,
                SystemObjectTypeId = vm.SystemObjectTypeId,
                TenantId = vm.TenantId
            });
        }
        return results;
    }

After Navigating to a specific service, inside the class inherited from ApplicationService the same [AbpAuthorize()] is Invalid as it cannot enter the class or method requested! I am using ASPNET Core and ANGULAR 5. Node Modules abp-ng2-module v 2.1.0 OS-Win 10

<cite>ismcagdas: </cite> UserId must be retrieved from claims, see <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp/Runtime/Session/ClaimsAbpSession.cs#L17">https://github.com/aspnetboilerplate/as ... ion.cs#L17</a>.

Can you use same code and debug it to see if claims contains userId or not ?

The session values exists in UserAppService, and after navigating from this class to other custom service the Abpsession.UserId becomes Null and the user is UnAuthorized to access this service [AbpAuthorize]. The user is successfully Logged and he is granted this permission using Roles.

<cite>ismcagdas: </cite> @sago what is your abp-ng2-module version ? Your problem might not be related to abp-ng2-module.

You can downgrade abp-ng2-module and see if it works for abp-ng2-module's older versions.

Downgraded didn't work, returned error Unexpected authenticateResult,

Angular 4 with core 1.1 works without any issue, Angular 5 with core 1.1 Under ABPSession object TenantId exists UserId becomes Null..

Showing 1 to 10 of 28 entries