We need to implement Oauth segregated by Tenant.
I looked into using https://abp.io/modules/Volo.OpenIddict.Pro but it does not seem to support this.
I found a partial solution in this question but it's missing a lot of details. https://abp.io/support/questions/4404/How-to-enable-Openiddict-for-multitenant
Can you provide some guidance on how to accomplish this?
Thanks so much.
To help anyone else looking. I wanted to share how we fixed the normalized name for multi-tenant subdomain.
Please refund the ticket :)
using System.Text.RegularExpressions;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
namespace MyProject.Blazor.Services
{
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(ITenantNormalizer))]
public class CustomUpperInvariantTenantNormalizer : ITenantNormalizer, ITransientDependency
{
public virtual string? NormalizeName(string? name)
{
if (string.IsNullOrEmpty(name))
{
return name;
}
// Normalize, convert to lower case, replace spaces and special characters with hyphens
string subdomain = name.Normalize()
.ToLowerInvariant()
.Replace(" ", "-")
.Replace("_", "-");
// Remove any characters that are not letters, numbers, or hyphens
subdomain = Regex.Replace(subdomain, @"[^a-z0-9-]", "");
// Ensure the subdomain does not start or end with a hyphen
subdomain = subdomain.Trim('-');
return subdomain;
}
}
}
-- Update NormalizedName field on Existing Tenants
DROP TABLE IF EXISTS #TenantsNormalizedNames;
CREATE TABLE #TenantsNormalizedNames
(
Id UNIQUEIDENTIFIER NOT NULL,
NormalizedName NVARCHAR(255) NULL
);
INSERT INTO #TenantsNormalizedNames
(Id, NormalizedName)
SELECT Id,
UPPER(
TRIM('-' FROM
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
NormalizedName, ' ', '-'
), '_', '-'
), '.', '-'
), '!', ''
), '@', ''
), '#', ''
), '$', ''
), '%', ''
), '&', ''
), '*', ''
), '(', ''
), ')', ''
), '''', '' -- Handling the single quote
)
)
) AS NormalizedName
FROM
[dbo].[SaasTenants];
SELECT t.NormalizedName, s.NormalizedName
FROM
[dbo].[SaasTenants] t
JOIN #TenantsNormalizedNames s
ON t.Id = s.Id
WHERE
t.NormalizedName <> s.NormalizedName;
UPDATE t
SET t.NormalizedName = s.NormalizedName
FROM
[dbo].[SaasTenants] t
JOIN #TenantsNormalizedNames s
ON t.Id = s.Id
WHERE
t.NormalizedName <> s.NormalizedName;
SELECT Name, NormalizedName
FROM
[dbo].[SaasTenants]
We have a use case where we need to hide some permissions for normal users and only expose them to super users such as the built in admin account or perhaps if the email address matches a certain pattern.
XyzWebPermissionDefinitionProvider seems to only run once at startup.
How can we override this core functionality to hide permissions at runtime?
Dear ABP Support Team, I hope this message finds you well. I am currently working on a Blazor WebAssembly application using the ABP framework and have encountered challenges while attempting to customize the bottom navigation bar for the mobile view.
Issue Description In our application, we need to modify the items displayed in the bottom navigation bar specifically for mobile users. The default menu items provided by the ABP framework do not align with our application’s requirements, and we wish to tailor the navigation options to better suit our users’ needs.
Current Approach I have attempted the following steps to customize the bottom navigation bar:
Modifying the Navigation Items: I tried to configure the mobile navigation menu using the following code snippet:
Configure<LeptonXThemeBlazorOptions>(options => { options.MobileMenuSelector = items => items.Where(x => x.MenuItem.Name == SafetyPlusWebMenus.Home || x.MenuItem.Name == SafetyPlusWebMenus.Employees); });
However, the changes did not reflect as expected in the mobile view.
Request for Guidance Given the challenges I have faced, I would greatly appreciate your assistance in providing detailed guidance on how to accomplish the following: Steps to Access and Customize the Bottom Navigation Bar: Clear, step-by-step instructions on how to locate the relevant components and modify the bottom navigation bar for mobile view. Best Practices for Customization: Recommendations on best practices for ensuring that the navigation items are properly displayed and functional within the mobile context. Dynamic Menu Items: If possible, please advise on how to implement dynamic menu items based on user roles or other criteria, as this is a requirement for our application. Troubleshooting Tips: Any additional troubleshooting tips or common pitfalls to avoid while attempting these customizations. I appreciate your time and support in helping us customize the bottom navigation bar to meet our specific requirements. Please let me know if you need any further details or clarification on our setup.
We need to implement IDataFilter to apply a filter against EmployeeId where a claim of EmployeeId has a value matching records on the table.
Trying to apply the documentation in the wiki has been difficult as some of the steps seem to be summarized.
Can you provide guidance on how to implement this feature?
When user login and logout of the application, and attempt to login as a tenant, user cannot see the "Login with this tenant" element under the action button
Steps to reproduce:
Expected: Users should be able to log in as tenants no matter how many times they log in and out of the application
Actual: Users cannot log in as tenants the second time
Attached is the video for reference (in the attachments) https://1drv.ms/v/s!AseK7NI9P0MAgc5WgkCbI4qhQYVOjA?e=Sd1cFo
When users log out of the tenant account, they are not redirected to the admin account as before. Currently, the user is also logged out of the admin account.
Attached is the video for reference (in the attachments) https://1drv.ms/v/s!AseK7NI9P0MAgc5Y6uPnBLmclDoRhQ?e=MJKijc
Steps to reproduce:
Expected: Users should be able to log in as tenants no matter how many times they log in and out of the application
Actual: Users cannot log in as tenants the second time
Attached is the video for reference https://1drv.ms/v/s!AseK7NI9P0MAgc5WgkCbI4qhQYVOjA?e=Sd1cFo
When user uses linked account to login to admin tenant from regular tenant the application crashes and logs out
Steps to reproduce:
Expected: Users should be able to login as Tenants and use linked accounts into the admin tenant as many times as they wish.
Actual: Users cannot see the login to admin Tenant from regular Tenant without getting immediately logged out