[GH-ISSUE #1288] I would like to use google authentication using subdomains, but my subdomains are dynamic... #8679

Closed
opened 2026-04-13 03:50:28 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @Iagopersantos on GitHub (Jan 27, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1288

Is this suited for github?

  • Yes, this is suited for github

I would like to use google authentication using subdomains, but my subdomains are dynamic.

Normally in the google api, I need to be specific when naming my subdomain, and it is impossible to pass “*” for dynamic cases, and I would like to use better auth to redirect to a domain that is specified in the google api, and return to the domain with the subdomain, for example:

The user will be at: https://subomain.domain.com/
When they log in with google, they go to the authentication domain: https://auth.domain.com/
After authentication, I want the user to be redirected to the domain: https://subomain.domain.com/

Being validated and authenticated, taking with them the browser cookies to validate the authentication.

Would it be possible to do this with better-auth?

Describe the solution you'd like

Possibility of logging in with dynamic subdomains, redirecting to a domain defined as auth and returning to the subdomain.

Describe alternatives you've considered

Use the proxy model that oauth already uses to redirect and authenticate the user.

Additional context

No response

Originally created by @Iagopersantos on GitHub (Jan 27, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1288 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. I would like to use google authentication using subdomains, but my subdomains are dynamic. Normally in the google api, I need to be specific when naming my subdomain, and it is impossible to pass “*” for dynamic cases, and I would like to use better auth to redirect to a domain that is specified in the google api, and return to the domain with the subdomain, for example: The user will be at: https://subomain.domain.com/ When they log in with google, they go to the authentication domain: https://auth.domain.com/ After authentication, I want the user to be redirected to the domain: https://subomain.domain.com/ Being validated and authenticated, taking with them the browser cookies to validate the authentication. Would it be possible to do this with better-auth? ### Describe the solution you'd like Possibility of logging in with dynamic subdomains, redirecting to a domain defined as auth and returning to the subdomain. ### Describe alternatives you've considered Use the proxy model that oauth already uses to redirect and authenticate the user. ### Additional context _No response_
GiteaMirror added the lockedstale labels 2026-04-13 03:50:28 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 12, 2025):

Hi, @Iagopersantos. I'm Dosu, and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You are facing a challenge with implementing Google authentication for dynamic subdomains.
  • Google API requires specific subdomain names and does not support wildcards.
  • You proposed redirecting users to a fixed authentication domain and returning them to their original subdomain with authentication cookies.
  • You are seeking guidance on how to accomplish this using the "better-auth" library.
  • There have been no comments or developments on the issue yet.

Next Steps:

  • Please let us know if this issue is still relevant to the latest version of the better-auth repository by commenting here.
  • If there is no response, the issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

<!-- gh-comment-id:2967419027 --> @dosubot[bot] commented on GitHub (Jun 12, 2025): Hi, @Iagopersantos. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You are facing a challenge with implementing Google authentication for dynamic subdomains. - Google API requires specific subdomain names and does not support wildcards. - You proposed redirecting users to a fixed authentication domain and returning them to their original subdomain with authentication cookies. - You are seeking guidance on how to accomplish this using the "better-auth" library. - There have been no comments or developments on the issue yet. **Next Steps:** - Please let us know if this issue is still relevant to the latest version of the better-auth repository by commenting here. - If there is no response, the issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8679