Base solution for your next web application

Activities of "eivanov"

Question

Hi there!

I wrote backend with api based on ABP/ABPZero.

Next i want to develop mobile application, which can do some requests to API. Mobile app will not have auth functionality, but i want to create one user in my backend for internal authorize in mobile app . It's for security reason, i don't want to open my api methods for public access, only for authorized users. And mobile client should use this user for request api methods.

But api/Account/Authenticate returns different tokens on every request and if i auth from one mobile phone then auth from another, first token becomes invalid. So, i need to auth on every request...It's impossible of course.

So, should i write own method Authenticate, which will store token and expiration time in database and not generate token on every auth request with same credentials, but return stored from database?

Hi there!

I have 2 questions about using CrudAppService:

  1. How can i use AbpAuthorizeattribute on CrudAppServiceclass? Overriding base methods is not good approach.
  2. How can i inherite CrudAppServiceclass from AppServiceBaseclass?

Hi there!

I have a model Country(title) and CountryAppService inherited from AsyncCrudAppService.

This service is fired from front app in some.js file. Base validation for my creating Dto(Required, MinLength..) work perfectly. But now i want to <ins>check duplicating on insert</ins> for the new country.

As i read about domain services, i should implement domain service CountryManager, inject IReposity<Country> into and implement InsertAsync method, where i can check duplicating and throw UserFreindlyException.

But my AppService don't know about my CountryManager, it's work with IReposity<Country>. I see 2 approaches for resolving this issue:

  1. Create CountryRepository, overriding InsertAsync method with CountryManager using. But i suppose this is bad way because of CountryManager use IReposity<Country> already.

  2. I can override InsertAsync method of my CountryAppService. Is this the right way or more graceful solution exists?

Showing 1 to 3 of 3 entries