DEV Community

KrushiVasani
KrushiVasani

Posted on

Understanding Basics of Authentication, Authorisation, and Identity Federation

In today's interconnected world, where online security plays a vital role, it's essential to understand the fundamental terms and protocols related to authentication, authorization, and identity federation. In this blog, we will explain these concepts in simple terms and explore some common protocols used for identity federation, such as OAuth 2.0, SAML 2.0, and OpenID Connect (OIDC). We will also delve into how these concepts apply to the AWS (Amazon Web Services) environment. Let's get started!

Authentication and Authorization:
Authentication refers to the process of verifying the identity of a user, typically done through a combination of a login and password. It answers the question, "Who are you?" Once a user's identity is established, the next step is authorization. Authorization determines what actions and resources a user is allowed to access. It answers the question, "What are you allowed to do?"

Identity Provider (IdP):
An Identity Provider, or IdP, is a system that stores and manages user data, such as email addresses and passwords. It serves as a trusted source for authentication and authorization. One commonly used IdP is Active Directory, which is widely utilized for managing user identities in many organizations.

Identity Federation:
Identity Federation allows users to use an external IdP instead of managing their own. With federation, you don't need to create your own sign-in code; instead, the IdP takes care of authentication and authorization tasks. By granting federated identities permission to use your resources, you can simplify user management and enable seamless access to various services.

OAuth 2.0, SAML 2.0, and OIDC:
These protocols are commonly used for identity federation, but each has its own characteristics and use cases. SAML 2.0 and OIDC are primarily authentication and authorization protocols, while OAuth 2.0 focuses on authorization for protected resources like APIs.

SAML 2.0, designed for enterprise usage, is more complex to implement but offers extensive functionality. It allows users to log into a corporate IdP and access other services without re-entering credentials. However, SAML 2.0 is browser-constrained and relies on browser security.

OIDC, on the other hand, is ideal for mobile and consumer-facing applications. It has a low barrier to entry and is based on OAuth 2.0. OIDC combines OAuth 2.0's authorization capabilities with an additional authentication mechanism, utilizing an ID Token in the form of a JSON Web Token (JWT).

Use Cases:
Let's explore some practical examples to better understand the use cases for these protocols:

OAuth 2.0: When you sign up for an app and agree to let it access your contacts on Facebook without sharing your login credentials. OAuth 2.0 enables API authorization without exposing sensitive information.

OIDC: When you sign in to an Identity Provider like Google and gain access to other websites, such as YouTube, without sharing your sign-in information repeatedly. OIDC simplifies the authentication process for various online services.

SAML 2.0: When you log into your corporate intranet or IdP and seamlessly access other services, like Salesforce, without the need to re-enter your credentials. SAML 2.0 streamlines the authentication and authorization process within an enterprise environment.

Identity Federation in AWS:
Amazon Web Services supports all the aforementioned protocols and provides two types of federation:

Web Identity Federation: This approach is suitable when you utilize well-known third-party IdPs like Facebook, Google, or any OIDC compatible provider. AWS enables integration with these IdPs to establish federated access.

Enterprise Identity Federation: If you use a corporate IdP compatible with SAML 2.0, you can leverage out-of-the-box integration with AWS. For example, Microsoft ADFS can be used to integrate with AWS, leveraging your existing Active Directory infrastructure. If your IdP is not compatible, you would need to develop a custom identity broker application to authenticate users, obtain temporary credentials from AWS Security Token Service (STS), and grant access to AWS resources.

AWS Services for Federated Access:
To enable federated access to your workforce, AWS provides the following services:

AWS IAM Identity Center: This service, which succeeded AWS SSO (Single Sign-On), allows you to define federated access permissions for users based on their group memberships within a centralized directory. It simplifies the management of federated access across multiple AWS accounts.

AWS Identity and Access Management (IAM): If you require the flexibility to use multiple directories or manage permissions based on user attributes, IAM provides a comprehensive solution. IAM allows you to define fine-grained access policies and manage users, groups, and roles within the AWS environment.

Conclusion:
Understanding authentication, authorization, and identity federation is crucial in today's digital landscape. By grasping the basics of these concepts and the protocols associated with them, such as OAuth 2.0, SAML 2.0, and OIDC, you can better navigate the complexities of secure user access management. In the AWS ecosystem, identity federation is supported through various protocols, enabling seamless integration with external IdPs. By leveraging AWS services like AWS IAM Identity Center and IAM, you can establish efficient and secure federated access for your workforce.

Top comments (0)