Security in Insecure world
Tags: idp, sso, security
Published: 2019-06-26 01:25:59

With growing usage of IT in day to day life, there are chances of misusing any available online services. According to economics times Over 15,700 **Indian websites** were reported **hacked** this year up to November 2018. So with the given dynamics lets see what all options we have to protect our resources. But before jumping to solutions and type of protection available let's get familiar with some common terminologies. Let's get started...

![alt text](https://media.giphy.com/media/1rKFPqZTrak8sH5nC6/giphy.gif)

​															[Image Source](https://media.giphy.com/media/1rKFPqZTrak8sH5nC6/giphy.gif)

*Relying Party*: A relying party (RP) is a computer term used to refer to a server providing access to a secure software application. Or we may say RP is a website or other entity on the Internet that uses an identity provider to authenticate a user who wants to log in.

*Claims*: Claims contains the information that we passed to the application like Name, Age, etc post authentication.

![](https://thepracticaldev.s3.amazonaws.com/i/qses3vq7lo1cl5o0w8mp.jpg)

​																					[Image Source](data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMSEhUSEhIWFhUVFhUWFRUVFRYXFhcWFRcXFhUVFRcYHSggGBolHRUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGxAQGisfHR8rLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tKy0tLf/AABEIALYBFQMBEQACEQEDEQH/xAAcAAEAAQUBAQAAAAAAAAAAAAAAAQIDBAUGBwj/xAA/EAABAwEEBQoEBAYCAwEAAAABAAIDEQQFEiETMUFRkQYUFSJSU2FxodEWMmOSB0KB4SNicrHB8DOCQ6KyJP/EANithyaAQEAAwEBAAAAAAAAAAAAAAABAgMEBQb/xAAuEQACAgECBQMDBQEBAQEAAAAAAQIRAxIhBBMUMVEFFUEiUmEyQmJxgSPBJDP/2gAMAwEAAhEDEQA/APcUAQBAEAQFJKdxRhXneUcDcUjgNw2nyG1YymoI24cE8zqCPNeUfKR87s8mA9Vg1Zai47fJcGTO5bH03B+nxxR37mjdykZtfF49dvusYxbOpzxx2svMvkkAgNIOojMEbwVi9mbY44SWuLspmv3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QlAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQEIQ5zlTyUitjesKOHyuGRCxcLOjFxDgeN35c01kkwStJaTk8ajTVXcVyzge1w/FLJ3MCviOK10zqeWIqN44ppY5kRUbxxTSxzYio3jimljmxFRvHFNLHNiKjtDimljmRAcXEMYC57smtbmSf01LOMLMMvERgtj0jkX+HuEtntYq/W1n5W/ptK6McNLs8XiOLc9j0uGMNAAFAPBbThbtlYQEoAgCAIAgCAIAgCAIAgCAIAgCAIAgCAIAgCAIAgIQUjBvK7Ip24JGhw8QjSZYzlHsaf4GsfdN4BY6UZ8+fkfAtj7pvAJpRefMfAtj7pvAJpQ58x8C2Pum8AmlDnzHwLY+6bwCaUOfMfA1j7pvAJpQ58zKu7krZoX42RtDt9BVWkYvLJ9zeUVMAEBKAIAgCAIAgCAIAgCAIAgCAIAgCAIAgP//Z)

*Identity* : Are you the right person trying to access the application. For example, whenever you enter the office premise you need to show your batch to enter the premise.

*Identity Provider (IDP)*: Is the term for a server that authenticates a user (the server is connected to some account SQL database, AD, etc.). In India, Aadhaar is used as IDP to confirm our Identity. 

*Authentication Vs Authorization*: Authentication verifies you are who you say you are whereas Authorization decides if you have the permission to access a resource. Authorization occurs post authentication is successful.

**Only an IDP can perform user authentication**

*Service Provider*: SP is an entity which is providing service. As we can see in below example here we are trying to protect an SP which has a trust established with an IDP. So whenever someone tries to access the service provided by Service provider they need to be authenticated against the IDP and post successful authentication the user can the resource. In a real-world example, we can think of SP as google drive and IDP as google. So to access google drive you need to log in with your Google credentials first.

![allt text](http://salesforcememo.com/wp-content/uploads/2017/09/access_server.png)

​														[Image Source](http://salesforcememo.com/wp-content/uploads/2017/09/access_server.png)

*Federation Provider*: FP is often used for a server that receives a SAML Token from another server. And then forwards it to the next Relying Party. For example, In case if you have forgotten your office Id card in home and the security personal stops you on the gate. Instead of asking you puzzles to confirm your Identity he federates/ redirects you to the main office to get temporary Id card for the day.

*Identity And Access Management*: IAM refers to a framework of policies and technologies for ensuring that the proper people in an enterprise have the appropriate **access** to technology resources. Also called **identity management** (IdM), IAM systems fall under the overarching umbrella of IT security. 

![](https://cdn-images-1.medium.com/max/1200/1*ytjCMDPDQVgEJbRuYpAttw.jpeg)

​														[Image Source](https://cdn-images-1.medium.com/max/1200/1*ytjCMDPDQVgEJbRuYpAttw.jpeg)

In the real world, the best example is your Aadhar/ Green Card.  When you present your Aadhar/ Green Card to the bank to prove that you are you, the bank (service provider) is trusting that the Aadhaar/ Green Card(identity provider) has properly vetted you with birth certificates, social security cards, or other identity information. Because of this trust, or federation, you don't have to carry all of these documents with you everywhere and prove to every single person that you are you. They trust the Aadhaar/ Green Card to have taken the appropriate steps to prove your identity.

Now since we have got some basic clarity on the security terminologies, let deep dive into more real-world challenges and the solutions available to overcome those challenges. 

**What is the basic component of IAM and what IAM system should include?**

Basic components of IAM:

1. How the individuals are identified in a system?
2. How roles are identified in a system and how do we provide the roles to the users?
3. How we will manage the roles of users?
4. Assigning levels of access to individuals or groups of individuals
5. Protecting sensitive data like PCI(credit cards info) within the system and securing the system itself.

IAM system should include all the necessary controls and tools to capture and record the above features. 

![](https://b.content.wso2.com/sites/all/2017-d7-theme/products-2018/identity-and-access-management/images/wso2-identity-and-access-management-archi-diagram.svg)

​																		[Image Source](https://b.content.wso2.com/sites/all/2017-d7-theme/products-2018/identity-and-access-management/images/wso2-identity-and-access-management-archi-diagram.svg)

**What is Roles Based Management?**

RBA helps us to manage the necessary permission for an authenticated user. Example: Using our employee office Id cards we can easily enter most of the floors but we can't enter server rooms. In case if you are a developer and you have access to server rooms, I think it's time to talk to your security team to strengthen the RBA policies :-)

![](https://docs.okera.com/assets/images/authz-rbac.png)

​																		[Image Source](https://docs.okera.com/assets/images/authz-rbac.png)

**What is Single Sign-On (SSO)?**

Imagine our condition if Google starts asking us to punch in our credentials every time we use any of their services. Our condition will be something like below. We surely don't want to ask users for credentials every time they use any of our services. Even if we own 10 applications, we should authenticate users only once and let them use all 10 applications. 

![SSO](https://media.giphy.com/media/Tb2i75AlI926I/giphy.gif)

​																			[Image Source](https://media.giphy.com/media/Tb2i75AlI926I/giphy.gif)

SSO is a user authentication service that allows a user to enter his credentials once and be able to access multiple applications. For example, if we want to access google drive or google album or google contacts, we need to login into our google account once and we can access all of them without entering the password every time. Please refer below image for better understanding.

![alt text](https://doubleoctopus.com/wp-content/uploads/2018/05/SSO-processxml.png)

​														[Image Source](https://doubleoctopus.com/wp-content/uploads/2018/05/SSO-processxml.png)

**What is SAML and how it works?**

Now we are clear that we should ask users to enter their credentials only once even if they want to access our multiple applications. But how will we know it is the same user? For example, we have 2 application A and B and user enter credential to access application A and now wants to access application B. We need to have a mechanism to let application B bypass authentication and handle validation internally without popping up the login screen to the user.

SAML stands for Security Assertion Markup Language. It is an open standard that allows Identity Provider (IDP) to pass authorization credentials to service providers (SP). 

SAML Provider is a system that helps a user access a service they need. There are primary 2 types of SAML providers:

1. Service Provider: A service provider needs authentication from the IDP to grant authorization to the user. 
2. Identity Provider: An identity provider performs the authentication that the end user is who they say they are and sends that data to the service provider along with the user’s access rights for the service. 

![SAML MetaData](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0-cd-02_html_m928aca6.gif)

​																	[Image Source](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0-cd-02_html_m928aca6.gif)

SAML works by passing information about users, logins, and attributes between the identity provider and service providers. Each user logs in once to Single Sign-On with the identity provider, and then the identity provider can pass SAML attributes to the service provider when the user attempts to access those services. The service provider requests the authorization and authentication from the identity provider. Since both of those systems speak the same language – SAML – the user only needs to log in once.

Each identity provider and service provider need to agree upon the configuration for SAML. Both ends need to have the exact configuration for the SAML authentication to work.

**What is OAuth and how it works?**

OAuth(Open Authorization) is an open standard for token-based authentication and authorization on the internet. An end user talks to their identity provider, and the identity provider generates a cryptographically signed token which it hands off to the application to authenticate the user. The application trusts the identity provider. As long as that trust relationship works with the signed assertion, you’re good to go. The diagram below shows how this works.

![](https://developer.okta.com/assets-jekyll/browser_spa_implicit_flow-9f0d10069f4363030e4283679bd4914f9aa47e192b32a166d1e186bdb929e1d2.png)

​																	[Image Source](https://developer.okta.com/assets-jekyll/browser_spa_implicit_flow-9f0d10069f4363030e4283679bd4914f9aa47e192b32a166d1e186bdb929e1d2.png)

Below is an example of OAuth:

![](https://developer.okta.com/assets-jekyll/blog/oauth/biketoworkday-fb-login-f00e39aabbf3e44bc3570333643cbf5d966fc27367dbffd2623ff4a3694831c3.png)

[Image Source](https://developer.okta.com/assets-jekyll/blog/oauth/biketoworkday-fb-login-f00e39aabbf3e44bc3570333643cbf5d966fc27367dbffd2623ff4a3694831c3.png)

There are multiple features provided by OAuth like: 

- Scopes and Consent
- Actors
- Clients
- Tokens
- Authorization Server
- Flows

Please refer [Blog](https://developer.okta.com/blog/2017/06/21/what-the-heck-is-oauth#saml) for more info.

**When we had SAML, why we need OAuth?**

SAML is basically a session cookie in your browser that gives you access to web apps. It’s limited in the kinds of device profiles and scenarios you might want to do outside of a web browser. Now we have modern web and native application development platforms. There are Single Page Applications (SPAs) like Gmail/Google Inbox, Facebook, and Twitter. They have different behaviors than your traditional web application because they make AJAX (background HTTP calls) to APIs. Mobile phones make API calls too, as do TVs, gaming consoles, and IoT devices. SAML SSO isn’t particularly good at any of this.

**What is Service Provider (SP) initiated Single Sign-On (SSO) Flow?**

When the service provider generates an request which is send to Identity provider as the first step in the federation process and the IDP responds with a SAML response we call this SP initiated flow. Refer below Image

Processing steps:

1. The user requests access to a protected SP resource. The request is redirected to the federation server to handle authentication.
2. The federation server sends an HTML form back to the browser with a SAML request for authentication from the IdP. The HTML form is automatically posted to the IdP’s SSO service.
3. If the user is not already logged on to the IdP site or if re-authentication is required, the IdP asks for credentials (e.g., ID and password) and the user logs on.
4. Additional information about the user may be retrieved from the user data store for inclusion in the SAML response. (These attributes are predetermined as part of the federation agreement between the IdP and the SP)
5. The IdP’s SSO service returns an HTML form to the browser with a SAML response containing the authentication assertion and any additional attributes. The browser automatically posts the HTML form back to the SP. **NOTE:** SAML specifications require that POST responses be digitally signed.
6. (Not shown) If the signature and assertion are valid, the SP establishes a session for the user and redirects the browser to the target resource.

**What is Identity Provider (IDP) initiated Single Sign-On (SSO) Flow?**

When the federation process is initiated by the Identity provider by sending an SAML response to the service provider. Refer below Image

Processing steps:

1. A user has logged on to the IdP.
2. The user requests access to a protected SP resource. The user is not logged on to the SP site.
3. Optionally, the IdP retrieves attributes from the user data store.
4. The IdP’s SSO service returns an HTML form to the browser with a SAML response containing the authentication assertion and any additional attributes. The browser automatically posts the HTML form back to the SP.

![](https://documentation.pingidentity.com/pingfederate/pf80/gettingStartedGuide/images/IdP__post.jpg)

​														[Image Source](https://documentation.pingidentity.com/pingfederate/pf80/gettingStartedGuide/images/IdP__post.jpg)

Let us look at real world example to understand above

**SP Initiated SSO**

Monika the user: "Hey Hari, show me your project report"

Hari the SP: "Hey, I'm not sure who you are yet. We have a process here so you go get yourself verified with Nithya the IdP first. I trust her."

Nithya the IdP: "I see Hari sent you here. Please give me your credentials."

Monika the user: "Hi I'm Monika. Here are my credentials."

Nithya the IdP: "Hi Monika. Looks like you a genuine user"

Nithya the IdP: "Hey Hari. Monika is authenticated user and here's some additional information about her. You do whatever you want from here."

Hari the SP: "Ok cool Nithya. Monika, Here you go!"

**IDP initiated SSO**

Monika the user: "Hey Nithya. I want to view Hari's project details. But Security is tight over there."

Nithya the IdP: "Hey Hari. I trust Monika. She is genuine user and here's some additional information about her. You do whatever you want from here."

Hari the SP: "Ok cool Nithya. Monika, Here you go!"

Reference:

[Identity And Access Management (IAM)](http://www.mcrinc.com/Documents/Newsletters/201508_IAM_Identity_Management.pdf)

[Enterprise IAM features](https://searchsecurity.techtarget.com/definition/identity-access-management-IAM-system)

[Federation Provider](https://blog.empowerid.com/blog-1/bid/249341/Federated-single-sign-on-in-the-real-world)

[Single Sign On](https://searchsecurity.techtarget.com/definition/single-sign-on)

[SAML](https://www.varonis.com/blog/what-is-saml/)

[OAuth](https://developer.okta.com/blog/2017/06/21/what-the-heck-is-oauth)

[SP Vs IDP Initiated SSO](https://blogs.oracle.com/dcarru/sp-vs-idp-initiated-sso)

[SP Initiated Vs IDP Initiated](https://documentation.pingidentity.com/pingfederate/pf80/index.shtml#gettingStartedGuide/task/idpInitiatedSsoPOST.html)