Below steps detail Moodle as IDP (Identity Provider) and WordPress as consumer of the service (i.e WordPress login through moodle system). I have started installation from the moodle link however find some steps are highlevel so in this post i have detail these steps so that this will help others.
We need 3 components to work this installation 1) SimpleSAMLphp local installation 2) Moodle plugin SAML Identity Provider 3) WordPress WP SAML Auth plugin.
Step 1: Download simplesamlphp from https://simplesamlphp.org/download and copy to your server /tmp folder. unzip the file using below command
sudo tar -xvf simplesamlphp-1.18.8.tar.gz
Copy extracted folder to /var/simplesamlphp
we need to enable /var/simplesamlphp/www folder access from web to perform the singlesignon. Make below changes to /etc/apache2/sites-available/default-ssl.conf file add below after the existing document directory.
Alias “/simplesamlphp” “/var/simplesamlphp/www”
add below in /etc/apache2/apache2.conf after “all directory permission granted”
#Allow simple saml allow for login and logout
<Directory /var/simplesamlphp/www/>
AllowOverride None
Require all granted
</Directory>
Restart apache2 : sudo service apache2 restart
lastly modify /var/simplesamlphp/config/config.php following:
‘baseurlpath’ => ‘simplesamlphp/’
check www.example.com/saml is working.. if you can see something below then you are good to proceed with next level modifications.

modify /var/simplesamlphp/config/config.php following
‘baseurlpath’ => ‘simplesamlphp/’,
‘secretsalt’ => ‘Generate Secreat Salt using command given on the file’,
‘auth.adminpassword’ => ‘Change it’,
‘store.type’ => ‘sql’,
‘store.sql.dsn’ => ‘mysql:dbname=dbname;host=localhost’,
‘store.sql.username’ => ‘db user name‘,
‘store.sql.password’ => ‘db password‘,
‘store.sql.prefix’ => ‘prefix‘,
‘technicalcontact_name’ => ‘Domain Admin’,
‘technicalcontact_email’ => ‘Domain Email contact’,
‘timezone’ => ‘update as per your timezone’,
‘enable.saml20-idp’ => true,
cert path change it to where your domain certificate available. Make sure you have server.crt and server.pem file in this directory. If you are using LetsEncrypt then change server.pem to server.key.
Create DB for SimpleSAML keep all the session information.
sudo mysql -u mysqladm -p
create database dbname;
create user ‘db user id‘@’localhost’ IDENTIFIED BY ‘db password‘;
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON dbname.* TO ‘db user id‘@’localhost’;
FLUSH PRIVILEGES;
modify /var/simplesamlphp/config/authsources.php following
// This authentication source serves as an example of integration with an
// external authentication engine. Take a look at the comment in the beginning
// of modules/exampleauth/lib/Auth/Source/External.php for a description of
// how to adjust it to your own site.
‘moodle-userpass’ => [
‘moodle:External’,
‘moodle_coderoot’ => ‘moodle installation root‘,
‘logout_url’ => ‘https://www.example.com/moodle/auth/samlidp/logout.php’, // plugin’s logout page
‘login_url’ => ‘https://www.example.com/moodle/login/index.php’, // standard Moodle login page
‘cookie_name’ => ‘MoodleSAMLIDPSessionID’,
],
modify /var/simplesamlphp/metadata/saml20-idp-hosted.php following
‘auth’ => ‘moodle-userpass’,
Login to moodle system and Install SAML Identity Provider plugin. provide following as input SimpleSAMLphp installation directory: /var/simplesamlphp
Auth source: moodle-userpass
Navigate to Site administration->Plugins->Manage authentication->SAML Authentication
and enable the module by clicking eye icon.
Verify Moodle authentication is working by below steps: Go to https://www.example.com/saml and click tab “Authentication” and click “Test authentication sources” and click “moodle-userpass” and you will routed to moodle loginpage. Once you authenticated in moodle and you will redirected to saml page with the attribute that are available for consumer.
see the wordpress consumer integration in my next post.
30 thoughts on “SimpleSAML Integration between Moodle and WordPress”
Every weekend i used to pay a quick visit this web site, for the reason that i want enjoyment, for the reason that this this web page conations really good funny material too.| Beatrice Nefen Merideth
Hello. This article was extremely fascinating, particularly since I was looking for thoughts on this matter last Wednesday. Deny Isaak Dam
I get pleasure from, lead to I discovered just what I was having a look for. You have ended my 4 day long hunt! God Bless you man. Have a great day. Bye| Robena Pepe Newman
Thanks to my father who informed me regarding this webpage, this webpage is truly remarkable. Row Samson Gilges
When someone writes an paragraph he/she keeps
the idea of a user in his/her mind that how a user can know
it. Therefore that’s why this paragraph is outstdanding.
Thanks!manifestation magic reviews
This site was… how do you say it? Relevant!!
Finally I have found something that helped me.
Appreciate it!
Feel free to visit my web blog … قیمت تور ترکیه
Hey very nice blog!
Hello there! This blog post couldn’t be written any better!
Looking at this post reminds me of my previous roommate!
He continually kept talking about this. I will send this post to him.
Pretty sure he’s going to have a great read. I appreciate you for sharing!
my web-site; 메이저 토토사이트
Nice blog! Thanks you all star articles good story!
If you would like to take a good deal from this article then you have to apply these techniques to your won weblog.
Also visit my blog post … Winifred
When someone writes an post he/she retains the image of a user in his/her mind that how a user can be aware of it.
Therefore that’s why this article is great. Thanks!
Stop by my homepage :: Quiz
Spot on with this write-up, I actually feel this
website needs a great deal more attention. I’ll probably be returning to see
more, thanks for the information!
Greetings! I know this is somewhat off topic but I was wondering if you knew
where I could locate a captcha plugin for my comment form?
I’m using the same blog platform as yours and I’m having trouble finding
one? Thanks a lot!
I am really loving the theme/design of your site. Do you ever
run into any internet browser compatibility problems? A few
of my blog audience have complained about my blog not working correctly in Explorer
but looks great in Chrome. Do you have any advice to help fix this
issue?
Check out my web blog … 스포츠토토
Hi there, just became aware of your blog through Google, and found that it is truly informative.
I’m going to watch out for brussels. I will appreciate if
you continue this in future. Lots of people will be
benefited from your writing. Cheers!
Very nice post. I just stumbled upon your blog and wished to say that I’ve
really loved surfing around your weblog posts. In any case I will be subscribing on your feed and I
am hoping you write once more soon!
Here is my blog post :: Belle
I read this post fully regarding the
comparison of most
up-to-date and earlier technologies, It’s amazing article.
It were a grief so brief to part with thee.
Thank you for any other excellent post. Where else may just anyone get that type of information in such
a perfect means of writing? I have a presentation subsequent week, and I am at the search for
such information.
Also visit my web blog; jasa Pembuatan company profile (oktaviani.photo.blog)
Have you ever thought about publishing
an ebook or guest authoring on other sites?
I have a blog based on the same subjects you discuss and
would love
to have you share some stories/information. I know my readers
would value your work.
If you are even remotely interested, feel free to send me an
e mail.
Hello there! I could have sworn I’ve been to
this web site before but after browsing through some of the posts I realized it’s new to me.
Anyhow, I’m definitely delighted I found it and I’ll be bookmarking it and checking back often!
Feel free to surf to my web page … jasa foto jakarta
Recommended Studying
Wonderful writing. Articles that have purposeful and also
informative web content are extra satisfying.
great and also amazing blog site. I truly wish to thank you,
for offering us much better information.
fantastic and also impressive blog site. I really intend to thank you, for
giving us better information.
terrific and also outstanding blog. I really wish to thanks, for
providing us better information.
I have found nice articles right here. I like the method you define.
So perfect!
It’s impressive that you are getting thoughts from
this piece of writing as well
as from our dialogue made at this time.
I really enjoy the blog article.Much thanks again. Awesome.
What’s up to every one, it’s truly a fastidious for me to pay a visit
this website, it consists of priceless Information.
Comments are closed.