Hi
please check this doc for resolving subdomain for tenant https://docs.abp.io/en/abp/latest/Multi-Tenancy#domain-subdomain-tenant-resolver
you can place this code in BookstoreSharedHostingMicroservicesModule {yourprojectname}.Shared.Hosting.Microservices
you can see the sample of ng tiered demo which will be similar to microservice. https://github.com/abpframework/abp-samples/tree/master/DomainTenantResolver/NG-TIERED
Hi,
Step 1 Disable Self registeration
Step 2
Create a role
if you don't want to manually create a role you can use dataseeder to seed the role data make sure to mark the role as default so newly created user will have that role automatically https://docs.abp.io/en/abp/latest/Data-Seeding
step 3 : create a Register.cshtml in AuthServer Project
Step 4: Inside register.cshtm place this code
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Account;
using Volo.Abp.Account.Public.Web.Pages.Account;
using Volo.Abp.Account.Settings;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity;
using Volo.Abp.Identity.Settings;
using Volo.Abp.Settings;
namespace Acme.BookStore.Pages.Account
{
[ExposeServices(typeof(RegisterModel))]
[Dependency(ReplaceServices = true)]
public class AppRegisterModel : RegisterModel
{
public override async Task<IActionResult> OnGetAsync()
{
if (IsExternalLogin)
{
await TrySetEmailAsync();
return await OnPostExternalInternalAsync();
}else
{
return await base.OnGetAsync();
}
}
private async Task TrySetEmailAsync()
{
if (IsExternalLogin)
{
var externalLoginInfo = await SignInManager.GetExternalLoginInfoAsync();
if (externalLoginInfo == null)
{
return;
}
if (!externalLoginInfo.Principal.Identities.Any())
{
return;
}
var identity = externalLoginInfo.Principal.Identities.First();
var emailClaim = identity.FindFirst(ClaimTypes.Email);
if (emailClaim == null)
{
return;
}
Input = new PostInput { EmailAddress = emailClaim.Value };
}
}
public virtual async Task<IActionResult> OnPostExternalInternalAsync()
{
try
{
await SetUseCaptchaAsync();
IdentityUser user;
if (IsExternalLogin)
{
var externalLoginInfo = await SignInManager.GetExternalLoginInfoAsync();
if (externalLoginInfo == null)
{
Logger.LogWarning("External login info is not available");
return RedirectToPage("./Login");
}
user = await RegisterExternalUserAsync(externalLoginInfo, Input.EmailAddress);
}
else
{
var localLoginResult = await CheckLocalLoginAsync();
if (localLoginResult != null)
{
LocalLoginDisabled = true;
return localLoginResult;
}
user = await RegisterLocalUserAsync();
}
if (await SettingProvider.IsTrueAsync(IdentitySettingNames.SignIn.RequireConfirmedEmail) && !user.EmailConfirmed ||
await SettingProvider.IsTrueAsync(IdentitySettingNames.SignIn.RequireConfirmedPhoneNumber) && !user.PhoneNumberConfirmed)
{
await StoreConfirmUser(user);
return RedirectToPage("./ConfirmUser", new
{
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash
});
}
await SignInManager.SignInAsync(user, isPersistent: true);
return Redirect(ReturnUrl ?? "/"); //TODO: How to ensure safety? IdentityServer requires it however it should be checked somehow!
}
catch (BusinessException e)
{
Alerts.Danger(GetLocalizeExceptionMessage(e));
return Page();
}
}
}
}
Now whenever there will be external login registeration will skip the CheckSelfRegistrationAsync check
Hello phil@travelengine.com.au,
Please let us know is there anything else that we can help you with?
Can we close this ticket if your query is resolved? Please confirm.
Thank You, Anjali
Hello Mohammed.sheik,
Please do let us know if this solution has worked for you?
If you are still facing the issue, please do share your solution on support@abp.io so that we can help you better.
Awaiting for your response.
Thank You, Anjali
Hello saad.aldulaijan,
Please do let us know if this solution has worked for you?
Awaiting for your response.
Thank You, Anjali
Hello smansuri,
Please do let us know if this solution has worked for you?
Awaiting for your response.
Thank You, Anjali
Hi,
it seems you have missing configuration and wrong audience specified in authserver module
please make following changes.
Make changes while adding authentication in serenderAuthServerModule
Also there is no configuration added in appsetting for configuration["AuthServer:Authority"];
in serenderAuthServerModule
Hello gozdeyildirmaz ,
https://github.com/swimlane/ngx-datatable/issues/1124
Can you please check above link. I am able to reproduce NullInjectorError
with different service files.
By adding service in providers that issue is fixed at my end as follows:-
import { ScrollbarHelper, DimensionsHelper, ColumnChangesService } from '@swimlane/ngx-datatable'
--> imports
providers: [ScrollbarHelper, DimensionsHelper, ColumnChangesService ]
---> added service in providers in app.module.ts
file
Please try this , if you are not able to solve the issue with current approach please let me know or you may share snaps of module files.
Thanks
Hi,
we will check and let you know asap.
Hi,
Can you provide the tenant switching context like after a tenant switch are you reloading the page?
because once you do this.routesService.remove(permissionProhibitedPageIds);
then this code nonLazyRouteItem.invisible = false;
will not work on the items that you have removed.
if you can provide step to reproduce this i can look into it more clearly.