Not working, won't log in to my other domains

Created on 11 June 2024, 5 months ago
Updated 10 July 2024, 4 months ago

Hello, I have currently installed the module and it does not work for me, once I change domain, it tells me that I have to log in again, when what I need is for the session I have in my first domain to be maintained when changing to the other, someone Could you give me a clue, since the module itself does not have any adaptive configuration.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇪🇸Spain miguemárquez

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @miguemárquez
  • 🇧🇪Belgium gorkagr

    Hi!
    You have to configure the domains on admin/config/multi_domain_login

    Then, once you do login in one domain, a session will be open in the rest of the domains configured.

  • 🇪🇸Spain miguemárquez

    @gorkagr Hi! Sorry for not responding sooner, I've had personal problems, I've tried what you've told me and it still doesn't work, any other ideas?

    Here I show you how I currently have it configured, thank you and greetings!

  • 🇧🇪Belgium gorkagr

    Seems to be good to me, i cannot say what might be the error.
    I have tested so far locally and all works for me so far.

  • 🇧🇪Belgium kriboogh

    Couple of things to know/check with this module: Sharing the session is not going to work, since session cookies can not be shared over different domains. The way this module works is that it will login onto the first domain where you first entered your login credentials (www.example1.com). It will then do a redirect to a temporary url (you can see/verify this in your browser dev console network history) on the second domain and log you in automatically. It will continue to redirect to all domains using temporary login urls and will finally then redirect again to the initial domain.

    So, check first if you see the redirects.

    If you want, you can enable extra watchdog logging to see what is happening (enable the "more debug" checkbox)

  • 🇪🇸Spain miguemárquez

    @gorkagr Thank you very much for your answer, it still doesn't work for me or at least I think it doesn't solve my problem

  • 🇪🇸Spain miguemárquez

    @kriboogh Hello, thank you for your answers, regarding the doubt, of course all the domains are made in Drupal.

    It still doesn't work for me in principle, my problem is wanting to edit a type of content that is in different languages ​​(domains) since I have to log in every time I want to edit it and of course in each of the languages, something tedious and that generates a waste of time for customers, I don't know if your module can solve this problem, if not, thank you very much for your time and I would appreciate any advice or possible solution to this, greetings!

  • 🇧🇪Belgium gorkagr

    my setup (so far locally), works as all the Drupal sites share the same DB (using the domain module)

  • 🇧🇪Belgium kriboogh

    @MigueMárquez this is exactly why we created this module. One website, each language has its own domain. We have this running in production now for over 6 years on a drupal multisite with over 160 websites on 3 domains. So not sure why it is not working for you then. Did you enable the extra debug logging? It might shed a light on what is going on. Also in your browser, can you see what the order of redirects is for your domains, when you start a login.
    If you have db access, check that your domains are correct in the settings config for the module (also check for language config overrides).

  • 🇪🇸Spain miguemárquez

    Hello, I have been checking the network history of the console and the only thing I have found is this, I don't know if it helps the question you asked me or I am wrong, at first it shows me this error (403 Forbidden), yes Can you guide me regarding the other questions, I would appreciate it, since I am not very expert in Drupal yet, greetings!

  • 🇧🇪Belgium kriboogh

    Goto multi domain settings and enable the "Enable extra logging" checkbox.
    Logout

    In your browser open the developer tools (right click on a page, "Inspect element")
    Open the network tab and enable preserve log or history.
    Clear the network history for clarity.

    Now goto https://www.domain.nl/user/login to login (pick any one of your domains)
    Hit login

    You should see your browser do some redirects looking like this (examples, the numbers will be different of course):
    https://www.domain.nl/user/login
    https://www.domain.fr/user/login/domain/1391393250/55276/1720185621/DyY3...
    https://www.domain.de/user/login/domain/1391393250/55276/1720185621/DyY3...
    https://www.domain.en/user/login/domain/1391393250/55276/1720185621/DyY3...
    https://www.domain.nl/user/1

    Also check the watchdog logs (https://www.domain.nl/admin/reports/dblog), you should also see the logins at the different domains (or errors if something goes wrong). You can filter the logs on "multi_domain_login" type if you want.

  • 🇪🇸Spain miguemárquez

    Hello, thank you again for your time, I have done everything you have indicated.

    Let me explain, I entered https://mitortuga.es/user/login and it automatically directed me to the domain https://matortue.fr/user/login/domain/6331894...

    In principle it redirects me but with an error as I show you in these images, I also don't understand why if I am logging in to the Spanish domain, I am automatically directed to the French domain, I don't know if it is my configuration error or if there is some module or something that causes conflict, since I am working with a project that is not my own, but has been created by other colleagues.

    Thank you again for your time and I hope that with your help, I can find a solution to this problem, greetings!

  • 🇧🇪Belgium kriboogh

    > I also don't understand why if I am logging in to the Spanish domain, I am automatically directed to the French domain

    Well,... you configured these domains:
    https://www.mitortuga.es
    https://www.matortue.fr
    https://www.mitortuga.ot
    https://www.mitortuga.de
    https://www.mitortuga.shop

    So if you first login on the spanish one, this module (multi_domain_login) will redirect to all the other domains in sequence to log you in, so it will redirect to;
    https://www.matortue.fr/user/login/domain/....
    then
    https://www.mitortuga.ot/user/login/domain/....
    then
    https://www.mitortuga.de/user/login/domain/....
    then
    https://www.mitortuga.shop/user/login/domain/....
    and then back to
    https://www.mitortuga.es

    1. You should check the watchdog logs (or php-error logs if you have access to those) to see why the redirect urls are giving you errors. Maybe some other module you use is also hooking into hook_user_login and is doing stuff that conflicts with this module, hard to tell.

    2. Maybe also check your thrustedhosts settings, all your domains should be listed in that config too.
    https://www.drupal.org/docs/getting-started/installing-drupal/trusted-ho...

  • 🇪🇸Spain miguemárquez

    Hello, I'm going to continue investigating but in principle these are the errors and logs that appear, I have reviewed both the thrustedhosts configuration and the domain configuration and everything is correct.

    I'll show you what appears to me and tomorrow when I investigate it correctly, I'll inform you more, greetings!

  • Status changed to Needs review 5 months ago
  • 🇧🇪Belgium kriboogh

    The error did rang a bell, we had that before. It was the toString function on urls that was causing metadata rendering to occur before the response was returned. I just noticed there is one such url->tosting call which isn't updated yet.
    I added this in the latest dev version, so if you can try this version, maybe it will solve the error you are seeing.

    Changing this to a bug report, since setup by you seems to be ok.

  • 🇪🇸Spain miguemárquez

    Hello, today it finally worked for me, although with some small errors that I will mention below.

    First of all, I would like to tell you that I have tried the version that you have indicated to me and it is the one that has worked for me.

    I tell you, at first everything worked well for me, in fact I leave you here a screenshot so you can see how the redirection to each of the domains is carried out, well the question comes that from one moment to the next, the domain mitortuga.es (Spanish ) has stopped working, giving me another 500 error.

    Another of my errors is that it has only worked with users who are clients, any user who has administrator or content editor permission has not performed the redirection, giving me the same error as yesterday (from mitortuga.es, try starting it in matortue .fr, which causes conflict).

    Is there any solution to these errors? since in principle everything is configured correctly.

    Thank you again for your help and interest, I am very happy with your efforts and the help provided, greetings!

  • 🇧🇪Belgium kriboogh

    There is no special permission for the module to work, so all roles should be able to login. Only permission that is needed for the login/domain path is that the user needs the permission "access content".

    I can't tell why you are getting a 500 on you Spanish domain, the error is to general, can be anything, if not even related to our module. When you have these kind of errors just check the logs, they usually give you a hint on what is going on.

    Also, if by any chance you see different behaviour between domains, just logout and login again. It can happen if you don't use a specific domain for a long time (cookie/session expiration settings) that you get logged out on that domain, while you are still logged in on the domain you use most of the time. This is just the nature of the cookie/sessions, not much you can do about that.

  • 🇪🇸Spain miguemárquez

    Hello, sorry for the inconvenience, I have been investigating today and it seems that the module is working with the administrator and content management users, apparently it is trying to do the redirection to the domains, with the only error being that does not load completely (appearing the error that I showed you previously), when updating the page, it goes through each of the domains (.fr, .pt, .de, .shop...).

    When performing the last f5, it loads and goes to the main domain, having full functions and being able to edit any type of content, regardless of the language, so my question now is, if there would be some type of solution for this, Because we have seen that it does work, but with these users I have that problem, I would appreciate your help and again as always, thank you very much for everything, greetings!

  • 🇧🇪Belgium kriboogh

    I see in the log you posted, that on some domains it says "already logged in". Maybe some error happens and the login process cuts out. Not sure when I will be able to test this, but I will check if this can cause such a white page error.

    On your end, can you logout out of all domains. Delete all cookies for each domain just to be sure. And then try to do a "clean" login (starting from .es domain for example). Just see if it goes through in this case.
    If you have access to your webserver or php-access and error logs, may there you can see what error is being thrown.

  • 🇪🇸Spain miguemárquez

    I have done what you asked me and I still have the same error, I am going to continue testing and investigating the errors and access to php, because in principle I do not see anything strange, I will also wait to see if you can check that error, anything I'll do commenting, greetings!

Production build 0.71.5 2024