![]() ![]() I will probably add an option for that but I am not sure that I will be able to programmatically override the default Moodle logout URL path. So what I think I need to do now is to create a custom logout.php that will also delete the session cookie so that Moodle stops trying to redirect me back to the last page I was on. There remains one a small annoyance which I have not had time to work out yet.Īfter logging out, when I click on a link to the course I was in before I logged out, instead of taking me to the course description as one would expect, it takes me to the SSO login page. So far this has been working great - for the most part. Unfortunately Moodle lacks an alternate Custom logout URL option like the one for logging in. Now when the user logs out, they are now clicking a link that will log them out of the SSO system and then get redirected to the Moodle logout URL. So I did some customization to change the logout URL toinclude the extra parameter. The result is that the user ends up logged out of both systems. The URL is where the SSO provider sends the web browser after you are logged out of SSO. In my case, after studying the SSO provider's documentation, I discovered that it supported a redirection parameter. It may be something that you can configure in the authentication plugin settings. Some authentication systems provide Moodle with a logout URL automatically. There are two possibilities that I know of. ![]() The trick to getting this to work is to find a way to end up logged out of both. ![]() You may also need to logout of Moodle too afterwards. In order to properly log out, you need to be logged out of you SSO provider. The reason it is logging you out and right back in again is because you are only ogging out of Moodle but not your SSO provider. Thank you for any insight and have nice day Is this going to work? If so, what would be the proper php library to call? I can imagine including and calling proper library in the html login file header, saving the html file as php file and putting it into the alternate login url attribute. I would like to use this simple alternate login html page instead of installing yet another plugin. (replace "yourdomain_and_path" by actual URL to the webroot of your Moodle site)ġ) To make it work, you need to install and enable the FilterCodes plugin which will allow you to process the tag into proper value on the html login page. From there, scroll down to the Alternate Login URL field and enter the following: You will find this Alternate Login URL field by going to Site Administration -> Plugins -> Authentication -> Manage Authentication. No need to re-create the Oauth2 plugin unless you really need to! For instance, neither "true" nor "false" seems to be correct for the user_login function in the event that the query parameter has been passed to simply display the default login however, one of these values is required for the plugin to work.ĭid you know that you can actually specify an alternate login URL in Moodle? We use it to make the login link (or button depending on your theme) take the user directly to the SSO Oauth2 system using the standard Oauth2 plugin included with Moodle. I have read the information at but it's still a little fuzzy. What is the best route to accomplish this? I am currently attempting to write an authentication plugin but I want to verify that I'm on the right track and learn some more about the functions I will need to implement to make it work. Instead, it should display the default Moodle login page and allow normal Moodle logins. One extra catch: if a specific query parameter is passed when accessing Moodle, it should not attempt to sign in automatically. We currently have the OAuth2 services enabled to allow the user to log in with their account by selecting the alternative login options ("Log in using your account on"), but we would like to bypass this extra button click while preserving its current behavior (if the user is signed in on our system, they will be signed in on Moodle if they are not signed in, they are redirected to our login page, they can sign in, and then be redirected back to Moodle as a logged-in user). I am very, very new to Moodle development and have been given a task to implement single sign on between my company's system and our Moodle server using OAuth2. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |