'Automatic Login from one web site to Moodle web site?
I have a portal called www.example.com and a Moodle site called moodle.example.com. I have some users on both sites, which have the same usernames and passwords. What I want is when a user logs in on non-Moodle site called www.example.com after clicking some link, he should auto login to the same user on moodle.example.com.
Is there any way to do this?
Solution 1:[1]
There are a lot of authentication methods that Moodle supports as standard (e.g. Shibboleth, OAuth 2.0, LDAP) and a great many others that it supports via 3rd-party plugins: https://moodle.org/plugins/?q=type:auth (SAML being quite a popular option).
Many of these can be configured to check the remote server and automatically log the user in, if the authenticating site has the user already marked as logged in (usually with a fallback to the standard Moodle login page, if this authentication fails).
Really it comes down to which (if any) SSO (Single Sign-On) authentication methods your www.example.com site is able to be an authentication provider for (or, at least, which methods it can be adapted to work as an authentication provider for).
All else being equal, I'd probably start my investigation with SAML and/or OAuth 2.0.
Whatever you do, please, please do not decide it's a good idea to come up with a brand new SSO method all of your own - unless you are an expert in writing secure authentication methods, I can almost guarantee it will be insecure and at risk of being hacked.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Joel Coehoorn |
