-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/Drupal/user/login returns a 'page not found' error #81
Comments
If you can't reach One thing you might want to ensure is that you have mod_rewrite installed (if you are using apache) or have url rewriting enabled if you are using IIS. Give that a shot & lemme know what happens. |
Thank you for your response! I now correctly installed mod_rewrite and am using clean urls. I don't know how much closer this brings me to the solution I need. When I go to localhost/drupal-7.x-dev/user/login?moodle_url=true&destination=CELO, I can now find a login page. Logging in just brings me to localhost/drupal-7.x-dev/CELO, however, which does not exist. I feel like I missed something really obvious when configuring the Drupal side of things, but I don't know what it is. The Moodle SSO module is enabled, the moodle-drupalservices module is enabled on my Moodle site. The domains are "localhost/drupal-7.x-dev" and "localhost/CELO". Any idea what could still be wrong? |
good, you are getting closer. the destination is definitely not correct. at a minimum it should be |
I just changed the code in auth.php to include such a slash, like this: I don't know if this is relevant, but in my Moodle's config.PHP I currently have: (I have also tried changing these to my local IP adress, rather than localhost or 127.0.0.1) |
You'll definitely want to make some changes here. The domain you access must be the same (or a subdomain of) the cookie domain. eg the If you set that up in moodle. Go over to drupal and log in as user 1 (the root user). once you've done that you should then be able to switch back to moodle, log in, and configure the sso plugin. One thing you can check to confirm things are working is, add the "editThisCookie" plugin to chrome. then once you've logged in to drupal, use that tool to check to see what the drupal session cookie looks like. it should read: Do some debugging there and let me know what comes up. the |
I have changed everything to say 'localhost', as you described, and just installed EditThisCookie. The Drupal session cookie correctly appears on Moodle, but the Moodle cookie does not appear on Drupal. I just added the following code to fix that issue: I am not exactly sure what is happening right now: I can no longer login to Moodle. When I click the "login" link/navigate to Any idea what to do next? I feel like I am making progress, so thanks a lot for the help thus far! |
Based on this: https://github.com/moodle/moodle/blob/master/lib/sessionlib.php#L137 I suspect that your you'll note that there are 2 variables used to construct the session cookie: |
Doing that, and changing instances of 'localhost' to '.localhost', brings me a step forward once again. I am now redirected to the Drupal "Page not found" page, The text is
Interestingly, it no longer seems to use the redirect code from auth.php. |
I know that this discussion has died down (in part because I was sick two weeks ago and didn't go to work for a few days), but I would be forever thankful if the problem I'm left with could be solved. I think it's probably a Drupal-side issue, but I have no idea how to fix this connection. |
I'm almost 100% sure this is a drupal problem too. I'm working on continuous integration tests for this, and one of the tests is the structure of your environment. I should have that this weekend. Once I do, I'll have a much better answer for you. In the meantime, take a look at the redirect in the moodle_sso module. My guess is, it's using the domain/drupal-7 path as the base URL to redirect to. If you check the docs and make it an absolute URL, that might help. More to come. |
Looking through htdocs\drupal-7.x-dev\sites\all\modules\moodle_sso, I find no mention of CELO at all. There are no options to configure Moodle_SSO on the Drupal website either. Where am I supposed to find the path for the base URL to redirect to? |
Hello, I am trying to connect a Drupal and Moodle website I have on my Apache server, accessing it through localhost. However, I am running into two main issues. My Moodle website is named "CELO", and my Drupal website is named "drupal-7.x-dev" in this situation.
My Drupal website cannot go to "/drupal-7.x-dev/?q=user/login?moodle_url=true&destination=CELO" (or "/drupal-7.x-dev/user/login?moodle_url=true&destination=CELO"). It gives the following error:
An alternative path I've tried is "user/login?moodle_destination=CELO", but this gives the same error.
Furthermore, mapping Drupal fields in Moodle is not possible. All of the fields can only be changed to '0'.
Do note that the mapping '0' is only available to me when I use the correct ip adresses for cookies, suggesting to me that a connection is being made, but that Drupal is not handling it correctly. However, I have installed all needed Drupal modules and more, and created the neccessary mappings.
Does anyone have any idea what could be going wrong here?
The text was updated successfully, but these errors were encountered: