K
Kinde•5mo ago
Neurath

Need some help with my custom domain for production.

Been trying to setup a custom domain: * I have a website setup with DNS to azure under a subdomain sub.domain.com.au * I can't setup kinde to also point to sub.domain.com.au so its pointing to account.domain.com.au * I have setup my google OAuth with the callback url to account.domain.com.au. * This is an SPA so every time I login and refresh a page is goes back to my login. * If change the Provider setting to isDangerouslyUseLocalStorage=true it works fine. * Not sure what I'm missing. Do you have to have the custom domain be the same url as the web address? this would never be possible because I need the CNAME record for the website to point to the correct address.
47 Replies
Oli - Kinde
Oli - Kinde•5mo ago
Hi @Neurath, Thanks for reaching out and sorry that you are experiencing issues with your custom domain setup. I will reach out to my team to help you on this.
Neurath
NeurathOP•5mo ago
Thanks 🙂
Oli - Kinde
Oli - Kinde•5mo ago
My team mate who is an expert with custom domain will be back online tomorrow. I will get them to look into your custom domain issues tomorrow. Apologies for the inconvenience.
Neurath
NeurathOP•5mo ago
All good just want to know what I'm missing I'm sure its something small but there are a lot of variables to put this together so its easy to get wrong
viv (kinde)
viv (kinde)•5mo ago
Hi @Neurath - just checking you've already verified your domain (step 5 here: https://docs.kinde.com/build/domains/pointing-your-domain/#:~:text=Once%20you%20have%20created%20the,SSL%20certificate%20will%20be%20provisioned) and the rest of the steps all look good? Can I ask which SDK you're using, as well as the version? Also double checking that I understand the err is that despite having custom domain, a refresh doesn't persist your authentication state? Would you also be able to send over your custom domain so we can see if there's any errs in the logs w/the custom domain / verification? Thank you!
Kinde docs
Use your own custom domain
Our developer tools provide everything you need to get started with Kinde.
Neurath
NeurathOP•5mo ago
No description
Neurath
NeurathOP•5mo ago
I'm using "@kinde-oss/kinde-auth-react": "^3.0.28" My website is compli.steltek.com.au
viv (kinde)
viv (kinde)•4mo ago
Hey @Neurath - I'm not seeing any errors or activity - are you able to let me know about the other q's also, might point us in the right direction. Cheers!
Neurath
NeurathOP•4mo ago
Other q's?
Neurath
NeurathOP•4mo ago
I thought that is what you meant but q's 1-6 are all good if I didn't have the correct DNS the verify in kinde wouldn't work right? I'm using godaddy
viv (kinde)
viv (kinde)•4mo ago
Hi, thanks for clarifying. Is this currently what you're running into / are you seeing any errors in console?
Also double checking that I understand the err is that despite having custom domain, a refresh doesn't persist your authentication state?
Also double checking that I understand the err is that despite having custom domain, a refresh doesn't persist your authentication state?
Are you also able to share a minimal reproducible example on Github repo so I can give it a go. Re this:
Do you have to have the custom domain be the same url as the web address? this would never be possible because I need the CNAME record for the website to point to the correct address.
Do you have to have the custom domain be the same url as the web address? this would never be possible because I need the CNAME record for the website to point to the correct address.
- that shouldn't be causing the issue - you should be able to have them seperate ie your website being something like www.domain.com and your custom domain being account.steltek.com.au
Neurath
NeurathOP•4mo ago
I could sit down with someone and go over the code via a call? but repoducing the whole thing in github would be very time consuming. Atm I login, and login works then it refreshes to page and goes back to the login screen. Only way it works is if I UseLocalStorage I'm also not paying for the custom domain option yet? is that required to make it work Sorry I only just saw this reply
viv (kinde)
viv (kinde)•4mo ago
All good, just double checking you're not running this locally on localhost:3000, you're experiencing this in production on account.steltek.com.au? I believe anything on this domain would persist without needing to use isDangerouslyUseLocalStorage, but localhost wouldn't
Neurath
NeurathOP•4mo ago
I'm using the website constant.steltek.com.au
viv (kinde)
viv (kinde)•4mo ago
I can see that hitting log in goes to https://steltek.kinde.com/ rather than https://constant.stelket.com.au - the cookie should be set on https://constant.steltek.com.au so may not be persisting as you're redirecting back to the kinde domain
Neurath
NeurathOP•4mo ago
So which setting do I fix for that to work?
viv (kinde)
viv (kinde)•4mo ago
this should be in your .env variables if you've set them otherwise may be <KindeProvider domain
Neurath
NeurathOP•4mo ago
ok let me try that
Neurath
NeurathOP•4mo ago
No description
Neurath
NeurathOP•4mo ago
now I ge this error instead?
viv (kinde)
viv (kinde)•4mo ago
looks like you're trying the kinde domain still ^^ https://constant.steltek.kinde.com/ in your address bar
Neurath
NeurathOP•4mo ago
that is what happens when I try to login ok back to logging in then back out again 😦 thats with the domain name change
Neurath
NeurathOP•4mo ago
No description
Neurath
NeurathOP•4mo ago
In the configuration you have this record that needs to be added, but thats not possible as this record is already in use to point the domain to there webserver. I'm not really sure how this would ever be possible for anyone to do?
Neurath
NeurathOP•4mo ago
No description
Neurath
NeurathOP•4mo ago
Any thoughts on this? I really would like to get this to work. Not sure why its so hard. I have set this up before with Auth0 and the other big provider and its usually very simple I think I see the issue I'm using a sub domain so I need to do kinde.sub.domain.com but when I do that it doesn't give me a kinde.sub DNS record it assumes I'm working at the top domain level
Neurath
NeurathOP•4mo ago
No description
alex_at_kinde
alex_at_kinde•4mo ago
@Neurath Just checking if you got your custom domain setup ok in the end? The multi-level setup can vary depending on whether you have a dedicate zone for the subdomain. We tried to articulate it in the following doc, but will take another pass at the section again. https://docs.kinde.com/build/domains/pointing-your-domain/#using-multi-level-subdomains
Kinde docs
Use your own custom domain
Our developer tools provide everything you need to get started with Kinde.
alex_at_kinde
alex_at_kinde•4mo ago
You're correct though in your screenshot, but maybe double check that ACME challenge record. For a DNS zone of just steltek.com.au: Record = account.constant Value = au.kinde.com Record = _acme-challenge.account.constant Value = The original ACME challenge URL, don't include extra subdomain
Neurath
NeurathOP•4mo ago
So it the auth url still constant.steltek.com.au ? which is the website url?
Neurath
NeurathOP•4mo ago
No description
Neurath
NeurathOP•4mo ago
No description
Neurath
NeurathOP•4mo ago
Those are my DNS recrods
alex_at_kinde
alex_at_kinde•4mo ago
Update this one to be "_acme-challenge.account.constant"
No description
alex_at_kinde
alex_at_kinde•4mo ago
And just double checking, you're still trying to register the following custom domain for your auth page? account.constant.steltek.com.au If it's still unverified, could you do the following * Delete the custom domain from the Kinde admin * Leave all the existing DNS records * Re-add it with the same "account.constant.steltek.com.au" This will force a refresh of the backend job that validates the DNS records so that it checks frequently. Over time, it checks less and less frequently, so we want to reset this back to the fast cadence.
Neurath
NeurathOP•4mo ago
Let me try all this and get back to you Ok did all that, but unfortunately still isn't showing up and authenticated. What do the logs on your end show?
alex_at_kinde
alex_at_kinde•4mo ago
I think it worked? This URL seems to load up correctly. https://account.constant.steltek.com.au/ The issuing certificate looks like from our provisioning service too.
No description
Neurath
NeurathOP•4mo ago
Hrmm but it still just keeps coming back to the login screen and the hook const { isAuthenticated } = useKindeAuth(); still shows false even when I preserve the logs
Neurath
NeurathOP•4mo ago
No description
Neurath
NeurathOP•4mo ago
I do see this error in the code
Neurath
NeurathOP•4mo ago
No description
Neurath
NeurathOP•4mo ago
No description
Neurath
NeurathOP•4mo ago
So it is returning the website
alex_at_kinde
alex_at_kinde•4mo ago
Forwarded this onto an engineer to join when they're available In the meantime, are there any environment variables that you setup on your app? For example, I've used the React starter kit a few times and one of the environment variables VITE_KINDE_DOMAIN set has to be the same URL as the custom domain auth page. I'm thinking something similar must have to happen on your .NET setup too? In your case it would be account.constant.steltek.com.au
Neurath
NeurathOP•4mo ago
<KindeProvider clientId={clientId} domain={domain} logoutUri={window.location.origin} redirectUri={window.location.origin} onRedirectCallback={onRedirectCallback} isDangerouslyUseLocalStorage={isDevelopment} > {children} </KindeProvider> domain is currently: https://constant.steltek.com.au I don't use .net Just node, React vite frontend and Nestjs backend I have built something like this before using auth0 in the past so I know it works to a degree Pretty sure Auth0 was using local storage for the token though Oh so I have the login working 🙂 on the frontend thank you I think I just need to update the backend domain too I updated the domain too account.constant.steltek.com.au I did have it as that before, but because the DNS was wrong it didn't work I figured it was something to do with the multi domain issue just its hard to debug that as the kinde page kind of shows you the wrong info in that situation 🙂 Its a bit more of a tricky situation so I understand why its hard to make it work for that scenario
alex_at_kinde
alex_at_kinde•4mo ago
It works! Awesome. Yea that multiple level sub domain thing comes up from time to time in the support channels, so we need to figure out a way to display that better.
Want results from more Discord servers?
Add your server