Base solution for your next web application

Activities of "chris.tune"

Hi All

This is relating to a question I raised on Modual Project Strucutre. https://support.aspnetzero.com/QA/Questions/9272/Question-on-Structuring-Project

By default the powertools creates files in the "main projects" Is there a way to configure the Power Tools to create the code in different projects? Or at least in a place where it's easier to extract :)

e.g. If I was creating a numbre of entities/services/etc in the MYFeature it would put them in a seperate project Base.Application Base.Application.Shared Base.Core Base.Core.Shared MYFeatureModule.Application <--- CREATE HERE MYFeatureModule.Application.Shared<--- CREATE HERE MYFeatureModule....<--- CREATE HERE

Cheers Chris

Thanks maliming that's exactly what I was looking for, thank you!

Hi All

I'm in the process of planning a project using the angulat + net core and wanted to ask advice on strucuring my .net project for the best maintainability. For example when I use the power tool it adds the code into the modules, but would it be better to have seperate project modules for parts of my app, this would allow me to more easily seperate the core ABP from my app services and domain logic etc.

e.g. Base.Application Base.Application.Shared Base.Core Base.Core.Shared MYFeatureModule.Application MYFeatureModule.Application.Shared MYFeatureModule....

etc.

Are there any best practices for this any where?

Cheers Chris

Hi All

I'm trying to achieve a few of things with background jobs:

  • Track running jobs for the user - for example an import so the user can see that it's still running, and progress(currently have a progress using signalR but would like a table).
  • Dont allow multiple jobs to run at the same time, for example, running a job which causes side effects more than once.
  • I understand there is a dont retry as well am I right in thinking this goes on the Execute method?

I dont want to have to build this out as it feels like I should be able to do this through the background job store etc.

Some design / code samples would be useful if possible :)

Thanks Chris

OK Guys for the time being I hacked around this.

On each token validated event I lookup the ABP user with my oid and manually add the claim to the identity. This now comes through in each request in the API. I'll have to make this cached etc as it's pretty painful looking up a user each request :) I'll probably make this middlware at some point and will share the code.

@richardghubert I want to say thanks for all your input and time. Appreciate your help.

Chris

Sorry I didnt explain well.

My bearer token validates OK, thats all good.

I auth with AzureAd, great get the token back...tick I now want to use this in an api call using it as Bearer Authentication. I've done this many times before but not with ABP.

We are in the same domain.. so CORS is OK.

My challenge is that although im sending a azureAd OpenIdCOnnect bearer token to the api, the ABSession UserId is not getting set. Which I assumed would be determined from the claim nameidentifier.

I'm was guessing in ABP somewhere it takes my name identifier and resolves this to the login then adds this to the ABPSession by adding it to the AbpClaimTypes.UserId claim... but maybe not?

The outcome of this is that when I call an api controller the ABPSession.UserId it's null.

I have set a http header for the Abp.TenantId in the api call just while I run locally and this is populated in the ABPSession.Tenant just fine.

I'm just wondering if my code is wrong or if the ABP code which populates the UserId is based upon cookie auth middleware or something.

I was just checking if pure Bearer Auth calls were compatible with OpenIdConnect tokens?

I might need to create a middleware or even in the JWT events add the AbpClaimTypes.UserId claim which ABP seems to use.

This is a lot more in depth than I thought it was going to be :D

Chris

OK Gents.

Maybe Ive just screwed my code... as the userId is not resolving when I pass the bearer token to the api. It has the correct claim and I even added a jwt sub claim as well.

I just want to double check. I'm wanting to use the bearer token using the JWT not a cookie as it's going to be called from external systems through the API.

Does ABP only support openId as a cookie??

Chris

Thanks richardghubert!

OK cool that's awesome info so just confirming :

ClaimTypes.NameIdentifier is the field that is used to lookup the login/user?

I'm guessing this is the same for both Cookie and JWT?

Chris

Hi All.

I'm stuggling to get all the steps and need some guidance if anyone can help?

For example: If you are using AzureAd or Azure B2C.

I see that in the above example we are adding an additional claim / rewriting based on a claim from AzureAD/B2C.

What are the claims that Zero looks for when resolving the user, for example if it's email there might actually be multiple idents with the same email, or the fact that it's not immutible?

For Azure AD you might want to use oid to have the same id accross Apps or sub if you want different id's accross different apps.

Do we have to use email? Can we override / configure zero to use a different claim for the id?

Thoughts anyone?

Chris

Showing 1 to 10 of 11 entries