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
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.
Thanks 🙂
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.
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
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.
I'm using "@kinde-oss/kinde-auth-react": "^3.0.28"
My website is compli.steltek.com.au
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!
Other q's?
apologies, the other questions here? https://discord.com/channels/1070212618549219328/1263372608947224608/1263726273239453719
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
Hi, thanks for clarifying. Is this currently what you're running into / are you seeing any errors in console?
Are you also able to share a minimal reproducible example on Github repo so I can give it a go.
Re this:
- 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
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
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'tI'm using the website constant.steltek.com.au
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 domainSo which setting do I fix for that to work?
this should be in your .env variables
if you've set them
otherwise may be
<KindeProvider domain
ok let me try that
now I ge this error instead?
looks like you're trying the kinde domain still
^^ https://constant.steltek.kinde.com/
in your address bar
that is what happens when I try to login
ok back to logging in then back out again 😦
thats with the domain name change
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?
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 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.
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
So it the auth url still constant.steltek.com.au ? which is the website url?
Those are my DNS recrods
Update this one to be "_acme-challenge.account.constant"
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.
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?
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.
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
I do see this error in the code
So it is returning the website
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
<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
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.