shadi
shadi
CC#
Created by shadi on 3/9/2025 in #help
Multi tenant implementation & Security
I was going to do that too! have an endpoint that updates your jwt based on the core app you want to use and correct me if i'm wrong, but i was going to do the following setup on mobile app: user logs in, I already know what part of tenants he's in i give him a jwt token to use general features that's available to everyone regardless of tenants specific features then, there's a section in my app where it shows him what active tenant he wants to see/interact with right now (it will be a list, i already have them as claims in the general token) when he chooses tenant A, i get his old token and generate a new tenant specific token that has all that tenant claims for authorization purposes, and my mobile app will attach either general token or tenant specific token based on the api url if he deals with api/dashboard: general token if he deals with api/core: tenant token if he switches tenant, his tenant specific token will get updated and so on
10 replies
CC#
Created by shadi on 3/9/2025 in #help
Multi tenant implementation & Security
no I already implemented the rest of my application but it was different than what I want right now What I did was allow each core app to create and manage its own users and have their own sign in page where it's something like domain,com/api/sign-in/{applicationName} it was deployed and being tested but recently changed the hosts and I found it better for me business wise to do what I mentioned. no authentication on core level a shallow copy of user is added to the core database once they join or get registered by that core app to their db this way it still allows users management to be centeralized in portalDb while having a shallow copy of that user in each coreDb the user joins example:
//when user signs up to my platform, this record is added in my PortalDb
class PortalUser {
public int Id {get; set;}
public string Name {get; set;}
public string Email {get; set;}
}

//when user joins a company, this record is added in the CoreDb of that company
class CoreUser{
public int Id {get; set;}
//doesn't have a relationship, will rarely be used, but need to keep track of what this user represents in my portalDb
public int PortalId {get; set;}
//cached properties from portal
public string Name {get; set;}
public string Email {get; set;
}
//when user signs up to my platform, this record is added in my PortalDb
class PortalUser {
public int Id {get; set;}
public string Name {get; set;}
public string Email {get; set;}
}

//when user joins a company, this record is added in the CoreDb of that company
class CoreUser{
public int Id {get; set;}
//doesn't have a relationship, will rarely be used, but need to keep track of what this user represents in my portalDb
public int PortalId {get; set;}
//cached properties from portal
public string Name {get; set;}
public string Email {get; set;
}
Withi this logic I am simply asking whether what I am suggesting is correct or is there a better approach to implement it the way I described
10 replies
CC#
Created by shadi on 3/9/2025 in #help
Multi tenant implementation & Security
in my humble opinion it's cleaner I implemented it with one database, then multiple, and i liked multiple better but that's out of the way since I already implemented the logic needed for database creation per tenant migrations switching connection strings at runtime...etc
10 replies
CC#
Created by slowly losing it on 8/26/2024 in #help
✅ how do i override built-in methods?
i think this would work on my phone so can't test public static MyClass operator ^ (MyClass a, MyClass b) { return new MyClass( a.Value ^ b.Value); }
20 replies
CC#
Created by shadi on 8/19/2024 in #help
Not angular specific - general guidance needed
@Sossenbinder but how would I suffix all the keys throughout the project if I can't find them in the first place? 😄 Also I don't wanna do it manually, file is huge and each key is used multiple times throughout the project
8 replies
CC#
Created by Reki- on 9/21/2022 in #help
loop
@Reki- Calculate how many spaces you need to print each line and how many stars in your first line, I think you need to print 4 spaces, then 1 star, then 4 spaces again (the last 4 spaces are unnecessary) then think of a pattern to draw you the first triangle up top, then do another loop that does the second shape
13 replies
CC#
Created by 4 on 9/21/2022 in #help
How to make Random Password Generator [Answered]
@cupck Split that string into char array. from there, you can decide how long each password is, and then setting each character to be of array[randomNumbe]
21 replies
CC#
Created by shadi on 9/13/2022 in #help
DateTime format into DateOnly
I can't find any statement like this online. all my other annotations are working fine
10 replies
CC#
Created by shadi on 9/13/2022 in #help
DateTime format into DateOnly
10 replies