Dave
Explore posts from serversKKinde
•Created by Dave on 4/22/2025 in #💻┃support
Multi-tenant (white-label app) design with subdomains
Hi, my nextjs app allows users to create their own apps to service their users, accessed by a subdomain (aka white labelling). I’m developing on localhost and getting state errors in the auth routing.
ITEM 1: Main app is working fine using a custom login page with http://localhost:3000 but I get state error (different id) with “app” subdomain:- HOME and LOGOUT URIs: http://localhost:3000 (can use http://app.localhost:3000 if fix requires it) LOGIN URI: http://app.localhost:3000/login REDIRECTS: http://app.localhost:3000/api/auth/kinde_callback , http://app.localhost:3000/api/auth/login-callback KINDE_COOKIE_DOMAIN= “.localhost” I’m testing with Google auth. They don’t allow localhost redirects in allowed callbacks on their site and I wonder if redirecting back to “app.localhost” is a problem???
ITEM 2: Client apps essentially have the same URL pattern as above except for using their subdomain vs. “app” subdomain. I programmatically create a new application in Kinde when a user deploys their app. Callbacks as follows: - HOME and LOGOUT URIs: http://someapp.localhost:3000 LOGIN URI: http://someapp.localhost:3000/login REDIRECTS: http://someapp.localhost:3001/api/auth/kinde_callback , http://someapp.localhost:3001/api/auth/login-callback NB: I’m using org_codes to represent organizations of users. One user database across all apps and app access granted to organization by subscription (using features). 1) Do I need a Kinde application for each “app”, or can I leverage subdomain wildcards and KINDE_COOKIE_DOMAIN? All subdomain apps will use the same authentication methods (Google, email etc) but each app will have its own custom login pages for uniqueness and white labelling. 2) Why am I getting state errors for app.localhost? Do I need to use a domain like "localtest.me" or explicitly add entries in hosts file for local development? 3) Am I using Kinde the best way for my app? Is there a better alternative design?
ITEM 1: Main app is working fine using a custom login page with http://localhost:3000 but I get state error (different id) with “app” subdomain:- HOME and LOGOUT URIs: http://localhost:3000 (can use http://app.localhost:3000 if fix requires it) LOGIN URI: http://app.localhost:3000/login REDIRECTS: http://app.localhost:3000/api/auth/kinde_callback , http://app.localhost:3000/api/auth/login-callback KINDE_COOKIE_DOMAIN= “.localhost” I’m testing with Google auth. They don’t allow localhost redirects in allowed callbacks on their site and I wonder if redirecting back to “app.localhost” is a problem???
ITEM 2: Client apps essentially have the same URL pattern as above except for using their subdomain vs. “app” subdomain. I programmatically create a new application in Kinde when a user deploys their app. Callbacks as follows: - HOME and LOGOUT URIs: http://someapp.localhost:3000 LOGIN URI: http://someapp.localhost:3000/login REDIRECTS: http://someapp.localhost:3001/api/auth/kinde_callback , http://someapp.localhost:3001/api/auth/login-callback NB: I’m using org_codes to represent organizations of users. One user database across all apps and app access granted to organization by subscription (using features). 1) Do I need a Kinde application for each “app”, or can I leverage subdomain wildcards and KINDE_COOKIE_DOMAIN? All subdomain apps will use the same authentication methods (Google, email etc) but each app will have its own custom login pages for uniqueness and white labelling. 2) Why am I getting state errors for app.localhost? Do I need to use a domain like "localtest.me" or explicitly add entries in hosts file for local development? 3) Am I using Kinde the best way for my app? Is there a better alternative design?
6 replies
KKinde
•Created by Dave on 4/18/2025 in #💻┃support
Can't find Workflows
Setting up a workflow. Have used an example and placed in environment/workflows in my repo per docs but am getting sync errors (not finding workflows). Have been trying different things including a kinde.json config file with rootDir = "environment/workflows". Filename of workflow ends in "...Workflow.ts". Am at a loss what to try due to limited ways to debug.
12 replies
CComposioHQ
•Created by adverse-sapphire on 3/24/2025 in #🖥│support-forum
Some "Default Connectors" not found errors
I've started walking down the list of apps alphabetically creating integrations with useComposioAuth=true and I'm getting this error for some apps:-
"Default connector not found, please set useComposioAuth to false and provide authConfig"
I get the error for Accuylynx, Amplitude, Apaleo (all different auth_schemes) but I don't get the error for Asana, Airtable, Google Calendar, Google Drive to name a few.
If I set useComposioAuth=false and authConfig={}, then I don't get the error for Acculynx (API key) and Amplitude (Basic) but I get an error for Apaleo, Airtable (OAUTH2) etc. where it is expecting fields.
I was going to add a condition to support this but I can't determine from the data structure returned what is different between each app that requires an useComposioAuth=false & authConfig={}.
My code is straight from the docs re. integration (includes workaround):-
let newComposioIntegration: IntegrationCreateParams = {
appUniqueKey: data.config?.name,
name: integrationName,
authScheme: data.config?.auth_mode,
useComposioAuth: false, // hardcoded workaround for testing prolem apps
authConfig: {} // hardcoded workaround for testing prolem apps
};
Please advise.
Thanks,
Dave
8 replies
KKinde
•Created by Dave on 1/27/2025 in #💻┃support
Pass custom parameters through authUrlParams
I have a multi-tenant/multi-app application. I'm trying to pass a custom parameter in authUrlParams to then access in the token as a custom claim. How?
Code:- <LoginLink authUrlParams={{ mz_application_id: "123" }}>Sign in</LoginLink> I've created a custom property for applications and marked it as public. The property passed in the token is null. I do receive a value if I set it through the UI, but this is not going to scale. Would love some guidance. Thx.
Code:- <LoginLink authUrlParams={{ mz_application_id: "123" }}>Sign in</LoginLink> I've created a custom property for applications and marked it as public. The property passed in the token is null. I do receive a value if I set it through the UI, but this is not going to scale. Would love some guidance. Thx.
5 replies
KKinde
•Created by Dave on 8/26/2024 in #💻┃support
How to use Is_create_org in NextJs.
The documentation is very brief on this parameter for NextJs. It doesn't give any details on what it actually does. I was assuming I could do something like:- <RegisterLink is_create_org={true}>Sign Up</...> but it doesn't appear to accept that parameter. When a user signs up, I want them to enter an organisation name that will be created besides their account. Thx.
9 replies
KKinde
•Created by Dave on 8/22/2024 in #💻┃support
"Invalid request error" post login. Http vs. https.
Hi, I've successfully been developing on localhost and have just tried to deploy to Vercel with this error:- {"error":"Authentication flow: Received: b874193af6978e5ad6a828eb3a1d | Expected: State not found"}
URL is stuck on this:-
[https://morezero.vercel.app/api/auth/kinde_callback?code=wQC-A]....
Obvioulsy I'm missing something in configuration but haven't been able to find it. I've verified my urls. Please help.
Thanks,
Dave
1 replies
KKinde
•Created by Dave on 8/18/2024 in #💻┃support
Need advice on multi-tenant design
My NextJs webapp facilitates companies developing apps and making them accessible via plans and subscriptions. Using an example, company A develops App1 and App2, accessible on app1.companyA .com and app2.companyA.com respectively.
Company B subscribes to a 5-user license for the use of App1 from company A (assuming via a product plan). Up to 5 users (employees) of Company B can create user accounts for App1 from Company A and access it. Company C subscribes to a 10-user license plan for App2, allowing up to 10 users (employees) from company C to use App2. Company C also offers its own app, App3, which is subscribed to by Company A. I’m assuming using features for app access and org_codes for separation of users by company will be part of the solution (also to leverage the upcoming plans/subscription functionality). However, I don’t know how to put it together, specifically, what is offered out of the box, and how to best implement what is not, utilizing Kinde framework. Please help. Thanks, Dave
Company B subscribes to a 5-user license for the use of App1 from company A (assuming via a product plan). Up to 5 users (employees) of Company B can create user accounts for App1 from Company A and access it. Company C subscribes to a 10-user license plan for App2, allowing up to 10 users (employees) from company C to use App2. Company C also offers its own app, App3, which is subscribed to by Company A. I’m assuming using features for app access and org_codes for separation of users by company will be part of the solution (also to leverage the upcoming plans/subscription functionality). However, I don’t know how to put it together, specifically, what is offered out of the box, and how to best implement what is not, utilizing Kinde framework. Please help. Thanks, Dave
9 replies