-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add DomainTenantResolver and with angular #3304
Comments
@ChangYinShung This might be related to angular-oauth2-oidc but I'm not %100 sure. Could you try to change your config like this; oAuthConfig: {
issuer: '',
clientId: 'BookStore_App',
dummyClientSecret: '1q2w3e*',
scope: 'BookStore',
showDebugInformation: true,
oidc: false,
requireHttps: false,
skipIssuerCheck: true
} |
@ismcagdas And CurrentUser Data {
isAuthenticated:true,
id: "59e5689b-a0a3-3633-8739-39f33b93bd77",
tenantId:null,
userName:"admin"
} When I login as tenant : http://testTenant.mydomain.com/ In Store data {
ConfigState:{
currentUser:{
isAuthenticated:false,
id: null,
tenantId:null,
userName:null
},
currentTenant:{id:'9dfd612c-b460-1922-9961-39f378e8cf90',name:'testTenant'}
}
} Host user login is work ,but testTenant not work ? |
Is it possible for you to share a test url and test credentails with us for testing tenant login ? If that is private, you can send it to info@abp.io. |
hi @ismcagdas , I upload my test project on github and write some test environment and description on |
The iis log print when i login to http://tenant1.furthersoftware.com.tw :
The error seem happen at but http response 200 ,but actually user login fail. |
So I skip the issuer check & audience check context.Services.AddAuthentication()
.AddIdentityServerAuthentication(IdentityServerAuthenticationDefaults.AuthenticationScheme, options =>
{
options.Authority = configuration["AuthServer:Authority"];
options.RequireHttpsMetadata = false;
//options.ApiName = "DomainTenantTest";
//options.JwtBackChannelHandler = new HttpClientHandler()
//{
// ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
//};
options.TokenValidationParameters.ValidateAudience = false;
options.TokenValidationParameters.ValidateIssuer = false;
},option=> { }); And it work ,but i dont know why And i find some reference here is my branch: https://github.com/ChangYinShung/abpDomainTenant/tree/skipIssuer |
hi, I have the same problem under the secondary domain. I refer to the link https://stackoverflow.com/questions/50119467/azure-multi-tenant-asp-net-core-application-with-bearer-authorization . //see https://github.com/abpframework/abp/issues/3304
// see: https://stackoverflow.com/questions/53515992/turn-off-issuer-validation-or-modify-valid-issuers-in-identityserver4
context.Services.AddAuthentication(IdentityServerAuthenticationDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
{
options.Authority = configuration["AuthServer:Authority"];
options.Audience = configuration["AuthServer:ApiName"];
options.RequireHttpsMetadata = false; // or false if you dont have https
options.TokenValidationParameters.ValidateIssuer = false;
}); it`s works.no other problems found |
Thank you for sharing your solution. At the moment, I don't know how to fix the problem when ValidateIssuer is true. |
Hi Guys, You all guys are doing wonderful job. Thank you so much for your efforts and wonderful thought. I am trying to test multi tenant (subdomain) on localhost using angular platform with following the below steps: What else should I need to do to consider subdomain from URL in angular project? |
Maybe you can customize IssuerValidator = (issuer, token, parameters) =>
{
if (expr)
{
}
return issuer;
} |
hi
when i add DomainTenantResolver at C# like this:
i deploy to iis and create a tenant call
testTenant
in angular environment.ts file i set apis url as blank
I open browser
http://testTenant.mydomain.com
and click login buttoncreate following http request :
the problem is user login in at :
http://testTenant.mydomain.com
login admin account, but ConfigState's CurentUser's tenantId is still null
or this issue is cause by
angular-oauth2-oidc
?The text was updated successfully, but these errors were encountered: