Single Sign On

Core SSO Elements


LDAP: Lightweight Directory Access Protocol


Structure of LDAP data

Example attributes
1
2
3
4
5
6
7
8
9
10
11
12
13
dn: uid=ghopper,ou=People,dc=navy,dc=mil
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: posixAccount
objectClass: shadowAccount
uid: ghopper
cn: Grace Hopper
userPassword: {crypt}$1$pZaGA2RL$MPDJoc0afuhHY6k8HQFp0
loginShell: /bin/bash
uidNumber: 1202
gidNumber: 1202
homeDirectory: /home/ghopper

Common attribute names

Attribute Stand for What it is
o Organization Identifies a site’s top-level entry (not used at sites that model their hierarchy on DNS)
ou Organizational Unit A logical subdivision, e.g. “marketing”
cn Common name The most natural name to represent the entry
dc Domain component Used at sites that model their hierarchy on DNS
objectClass Object class Schema to which this entry’s attributes conform

Hands-on: update your webserver profile


6: Hands-on: update and launch CloudLab


Hands-on: install and configure LDAP

1
2
3
clear
sudo apt update
sudo apt install -y slapd ldap-utils
1
sudo dpkg-reconfigure slapd
1
sudo ufw allow ldap
1
2
3
4
5
6
7
ldapadd -x -D cn=admin,dc=wcupa,dc=edu -W -f basedn.ldif
Enter LDAP Password:
adding new entry "ou=People,dc=wcupa,dc=edu"

adding new entry "ou=Groups,dc=wcupa,dc=edu"

adding new entry "cn=CSC,ou=Groups,dc=wcupa,dc=edu"
1
2
3
4
slappasswd
New password:
Re-enter new password:
{SSHA}N8Rfc9lvnKb8A3oUOxUOBlDen4v8FYL/
1
2
3
ldapadd -x -D cn=admin,dc=wcupa,dc=edu -W -f users.ldif
Enter LDAP Password:
adding new entry "uid=student,ou=People,dc=wcupa,dc=edu"
1
2
3
4
ldapsearch -x -LLL -b dc=wcupa,dc=edu 'uid=student' cn gidNumber
dn: uid=student,ou=People,dc=wcupa,dc=edu
cn: student
gidNumber: 5000

Hands-on: Setup SSO on client

1
2
3
4
clear
sudo apt update
sudo apt-get update
sudo apt install -y libnss-ldap libpam-ldap ldap-utils
1
2
3
4
5
getent passwd student
student:x:10000:5000:Golden Ram:/home/student:/bin/dash
lngo@webserver:~$ su student
Password:
$