My first comment on SAML is, I don’t like it’s name.
It says Security Assertion Markup Language. I feel like it’s name not properly conveying what exactly it is doing. When I first heard of it, I thought like it’s another new programming language and requires some steep learning curve. But luckily before diving too deep into it I came to know for what purpose SAML is used for.
Later after understanding something about it, I given a thought like what could be an ideal name for this. Of course no one on this universe bothers to know what I would name it but do you know the best part of having your own blog ?
"You can write any nonsense in that".
Anyway shall I tell you the name ?
I would have named it as UWAP (User Web Authentication Protocol).
I know what you are thinking. This name is more worse than SAML. right ? Ok leave it. Shall I tell you another name ?
Here we go !!
EXFA (Exchange XML For Authentication) .
Better ?
No ??
Ok leave it.
Let’s try to understand what it is.
I read somewhere in a tech book. Author of that book said "Computers are highly unsociable creatures. They won't talk to each other unless you tie them with a cable".
That author started networking concepts with this statement.
With the advent of internet we could tie our computer to uncountable number of computers in this universe. But it is only one main side of a story. The other side is, that computer should allow us to enter inside of it in addition to just communicating with it. Right ? Of course I'm bit oversimplifying here. Inside of computer means I intend to say web applications in that computer.
You may ask. What is big deal about it ? If that web application allows users to enter user id and password then they can enter into it otherwise they can't. right ?
True. If there are a dozen of applications like this, what you will do ?
I know your answer.
You will enter user ID’s and passwords of all the applications right ?
If there 20/30 applications like this ?
I know you are getting irritation now. Same answer as previous one right ?
But not all the people won’t have your level of energy Sir. People like me are gifted with poor memory and heights of laziness. You know what? My category of people only are more in this universe. I guess, person who invented this kind of technology probably did so due to the painful life of remembering all passwords.
Believe me. The main advantage of SAML is that only. You don't have remember your user ID and password is one advantage and you don't have to enter your user ID and password is another advantage.
It is cool right ? Who remembers all passwords except some kind of people who......….. I mean, I didn’t say anything about you.
If you have to access 20 websites for example, remembering and entering all passwords, maintaining them (each websites defines their own password policies and expiration timings) and contacting their support teams in case of any login issues is an irritating exercise to imagine right ?
If your Organizations has 1000s of users(which many organizations do), supporting user authentication issues for all those different websites will itself become a nightmare. For this exact same challenge, our super technical geeks came up with couple of solutions and one of the popular one is SAML. But since it doesn't sound nice if they say this technology helps those who forgets passwords, they given a fancy name for that use case and said it is used for SSO (Single Sign On). Means only one thing. You just remember one user ID and password of your organization's main website. For remaining all other applications, just forget it. No worries.
I know your next question.
Without entering user ID and password how those outside applications allows me ? (From now on, I will call these outside applications as "vendors" for simplicity).
Straight answer to this question is, you already entered your credentials in your organization portal right ? It will capture them internally and send your details in an XML file whenever you click on a vendor link from within your organization portal.
This way of communicating with external applications in XML format is called SAML.
I know you got another question.
If I simply send my details in XML file how come they are accepting and allowing me ? Is that my password is same for all vendor portals ? Some portals asks my ID, some portals my email ID. But I did not enter them all in my login. How all these are managed ?
Ok. Before you feel bored of reading any further, I will give few statements rather than explanation.
1. When you enter your login credentials, your other profile details can also be pulled by your application right. That means your login application has all your details. Now it can send whatever vendor expect for login. It can be your ID or email or last name or SSN etc.[As a side note just remember, in SSO world, the application where you enter your user id and password is called identity provider]
2. Vendor's won't accept if you send these details in your own XML format. There is a globally agreed standard XML format for this purpose. We need to send details in this standard structure only.
3. There is no need to send your password in SAML. Instead of that they will send a digital certificate along with your details mentioned above. Content of this certificate will be encrypted and added as one of the XML tag in your SAML file. In other words, your details (We can say your attributes) and digital certificate will be sent in a single XML file. This digital certificate is your password like you can assume.
4. Ok. Instead of password, we are sending certificate. How vendors know if it is a valid certificate? Simple answer for this is, vendor also will have one copy of the same certificate at their end. We need to send our certificate to them so that when your users try to reach them, they will compare certificate data in our XML file with the certificate which you have given to them. Both should match.
4. Certificate is fine. How does your vendor know you are a valid employee of your organization ? Just by sending some user ID in XML how they are allowing ? No boss. They won't allow like that. There is a pre-requisite activity which supposed to happen even before you try SSO. That activity is, your organization should send all your employee details separately to all the vendors. Then vendors loads all the details in their databases. One technical word given to this activity. It is called "feeds". Once feeds are completed, then only we can say ground for SAML is all set.
5. You may get one more question. Like my organization, many organization employees will communicate with vendors through SAML. How vendors differentiate various organizations ? Is all employee details from all organizations won't create any mess ?
No.
In addition to just employee details and certificate you also need to exchange some other details to uniquely identity your organization. For this, you have to share few additional details and those details also we need to send in our XML file. What details we need to exchange with our vendor ? These details which are supposed to be exchanged are also given a fancy name and is called as "metadata".
That's why whenever any new vendor comes for SSO, first thing your organization will be asking them to share is metadata. As an additional input I'm briefly giving here what details will be exchanged in metadata. Here we go.
1. Your organization (Identity Provider) requires below details from vendor
* Entity ID/Audience (This is your vendor ID. Usually it's value will be like "https://vendorportal.com/xxxxx or it can be like a straight text like xxxxxxxxxxxxxxx"
* ACSURL (Vendor URL to where you need to send SAML assertion file. It's value could be like "https://vendorportal.com/saml/consume")
* Attributes (Attributes can be many. Your vendor asks you what attributes they are expecting from you. One common attribute will be NameID where you pass your userId/userName)
* RelayState (Optional parameter. This is Vendor URL which will be loaded after successful authentication. Value can be "https://vendorportal.com/dashboard")
2. Your vendor (Service Provide) need below details from your Organization
* X.509 certificate (Certificate given by you. As explained before, Once vendor setup this certificate at their end, for each request from you, vendor will cross check certificate sent through your SAML to make sure you are a trusted entity)
* Issuer URL (Your organization ID. In other words unique identifier of Identity Provider. Sample value can be like "https://otis.com/saml2")
That's it. Once these details are set at both ends, you and your users are all set to communicate with your vendor.
Hope you got some idea on SAML. Now you can read some serious material about SAML in other super guru's technical websites. If you feel comfortable reading that stuff now then the purpose of this post is solved.
Happy learning !!