Hi,
I have multitenant microservice application. appsettings details are different for each tenant. I wish not to maintain a appsettings file or if I have to then I have to maintain only common settings there. But my other tenant related settings should come from database.
How do I achieve this , any suggestions ?
Hi,
My requirement is similar to this ticket : https://support.abp.io/QA/Questions/1087/DbMigrator-for-multi-tenant--multi-db
But I can't see any resolution on this ticket. Please can you help me with it.
Also If you can answer below question it will be helpful
Hi,
Our application is based on micro-service architecture.
In my application I have
The solution is not implemented by abp.io Microservice template but it was implemented by your guidance and works as expected. Till now we had only one tenant but still multi tenancy was enabled in our application. Now we want to add few tenants to our system and facing below issues.
Issues :
Each of the repository is custom repository https://docs.abp.io/en/abp/4.4/Repositories#custom-repository-interface I also tried to implement custom MultitenancyConnectionStringResolver. https://docs.abp.io/en/abp/4.4/Connection-Strings#replace-the-connection-string-resolver
My Questions :
Please try to give deep explanation as the whole process is bit complex as we are not having the same template as abp.io microservice template
I have implemented override for SignInManager
and have done some custom logic check in CanSignInAsync()
method
If my custom logic fails I thrown Exception
ie. throw new AbpValidationException(...my_error_message...)
On angular side I am not getting any error response in json format to handle, it's directly throwing the below error, below are the details from network tab.
Volo.Abp.Validation.AbpValidationException: Inactive user
at SCV.Litmus.LitmusOverrides.LitmusSigInManager.CanSignInAsync(IdentityUser user) in D:\Litmus\Projects\ar-allocation\SCV.Litmus\aspnet-core\microservices\SCV.Litmus.IdentityServer\LitmusOverrides\LitmusSigInManager.cs:line 56
at Microsoft.AspNetCore.Identity.SignInManager`1.PreSignInCheck(TUser user)
at Microsoft.AspNetCore.Identity.SignInManager`1.CheckPasswordSignInAsync(TUser user, String password, Boolean lockoutOnFailure)
My expectation was something like this : https://docs.abp.io/en/abp/latest/Exception-Handling#validation-errors
{
"error": {
"code": "App:010046",
"message": "Your request is not valid, please correct and try again!",
"validationErrors": [{
"message": "Username should be minimum length of 3.",
"members": ["userName"]
},
{
"message": "Password is required",
"members": ["password"]
}]
}
}
How to get the above type of details by throwing error from SignInManager ?
Is there any answer for this question ?
@albert Please reply.
I was able to validate user credentitals using await _signInManager.CheckPasswordSignInAsync()
Now I just want to know below things, This is angular login component code
login(params: LoginParams): Observable<any>; Which backend method is called when the above method is called from angular component ?
May be I can make a wrapper method and call this backend login method in my method once I done with my requirement.
import { Injector } from '@angular/core';
import { Params } from '@angular/router';
import { Observable } from 'rxjs';
import { LoginParams } from '../strategies/auth-flow.strategy';
import * as ɵngcc0 from '@angular/core';
export declare class AuthService {
protected injector: Injector;
private strategy;
get isInternalAuth(): boolean;
constructor(injector: Injector);
init(): Promise<any>;
logout(queryParams?: Params): Observable<any>;
/**
* @deprecated Use navigateToLogin method instead. To be deleted in v5.0
*/
initLogin(): void;
navigateToLogin(queryParams?: Params): void;
login(params: LoginParams): Observable<any>;
static ɵfac: ɵngcc0.ɵɵFactoryDef<AuthService, never>;
}
Requirements
Current situation
I hope you got my requirements clear. Please suggest me the easiest way to achieve this.
How to get selected language for a logged in user i.e. english, chinese etc. at application service level
"tr" "pt-BR" "en" "zh-Hans" "sl"
and where is it stored in db ? i.e.which table ?
Can you share a simple project?
No I can't.Sorry May be we can have a section and you can have a look into my project.