Authorization is a very common term in computer security. But most people confuse it with authentication. Let me explain it with an example.
Now, let's dig deeper into the topic and see why authorization has become a major security concept.
Authorization is the process of deciding what actions, parts of a website, or application a given user can access after they have been authenticated.
Once you are authenticated, the backend server checks your roles, permissions, or access levels. Then, it determines what actions you can perform and which resources you can access.
With proper authorization, users can do only what they are allowed within the application.
In authentication, a user’s identity is verified to grant access to a system. Users must input their login details, like a username or email address and password, for verification. After successful authentication, the server identifies whether the user is trusted to access the system. Authentication involves transmitting information through an ID token.
In authorization, a user’s permissions are checked to decide which actions they can perform on which resources. Authorization requires the user’s privileges or security levels. At the end of this process, it determines what permissions a user has. Information is transmitted through an access token during authorization.
Let's compare the differences between authorization and authentication with a table.
Aspect | Authentication | Authorization |
---|---|---|
Purpose | Verifies the identity of users to grant access to a system. | Verifies the user's permissions to access specific resources. |
Process | Users are identified and confirmed. | Users' permissions are assessed and validated. |
Order | Occurs before authorization. | Takes place after authentication. |
Governing Protocols | OpenID Connect primarily handles user authentication. | OAuth 2.0 primarily manages user authorization. |
Common Techniques | - Password-Based Authentication - Passwordless Authentication - Two-Factor/Multi-Factor Authentication - Single Sign-On (SSO) | - Role-Based Access Control - JSON Web Token (JWT) Authorization - SAML Authorization - OpenID Authorization |
Identification Methods | Involves username, password, and biometrics like face recognition, retina scan, etc. | Uses role-based access controls and pre-defined access rights to resources. |
Let's consider some practical use cases to understand how authorization is used in real-world use cases.
In financial management systems, a junior accountant may only have access to input and view transaction data. However, a senior accountant or finance manager has the authorization to approve transactions and generate financial reports.
Next, let's take a hospital's electronic health record system. There, a nurse might have the authorization to view a patient’s medical history and update routine care notes. However, a doctor could have high-level access to prescribe medications and modify treatment plans.
Learning about how authorization works is important because that helps you to implement proper access control for your systems. It starts with authentication.
Let’s look at the most common authorization techniques.
RBAC is the process of assigning permissions to system users based on a user role. This approach is more manageable than directly assigning permissions to a user.
ReBAC grants authorization based on the relationships between users and resources. For example: A user can edit a document they created but can't edit documents created by someone else.
In this method, instead of assigning permissions individually, you can group users together and assign permissions to the entire group. This is helpful when the organization scales.
ABAC grants permissions based on a user's attributes or characteristics. In this method, an organization’s access policies make decisions based on the attributes of the subject, resource, action, and environment involved in the access event.
For example, it can be based on:
SAML is an open standard. It is used for exchanging various types of authorization details between an identity provider and a service provider. In a basic role-based access control scenario, a SAML assertion from the identity provider can include user roles as attributes. The service provider then uses these roles to grant access to specific resources.
XACML is an XML-based policy creation language. Users can define access control policies defining who can do what and when. It is mainly used as an attribute-based control authorization solution.
OIDC is considered an authentication as well as authorization protocol. It was created on top of OAuth 2.0. This is used for providing SSO among multiple applications. During the authorization process, OIDC issues access tokens that are used to authorize applications to access user data.
Also, it supports defining scopes and managing user consent. OIDC also supports token revocation, so that admins have the capability to revoke access to any resource during any emergency.
JWT (JSON Web Token) provides authorization by generating a token that contains encoded user information, which the server can verify and decode using a secret key. This token passed from the backend to the front end, is sent with API requests to access protected routes. The server checks the token's validity to grant or deny access. These tokens include an expiration time to limit unauthorized access in case the token is compromised.
After learning about how authorization functions and the various techniques involved, here is a list of the key benefits of authorization:
One of the major challenges in implementing authorization solutions is that these models require careful management. Therefore, if you fail to manage the system properly it can lead to issues such as:
Another challenge is that inadequate authentication methods, like weak passwords, can compromise authorization controls.
Also, errors in security configuration and data management can result in unintended security breaches, such as misconfigurations or assigning incorrect permissions.
Here is a list of recommended best practices for implementing authorization solutions.
Need to design authorization solutions early in the software development lifecycle. It helps to thoroughly plan the roles and privileges. So it won't add complexity as the application scales.
Utilize authorization policies like RBAC, ABAC, or mandatory access controls to enforce fine-grained access. Implement a default deny policy to prevent unauthorized access, even if other controls are bypassed.
Maintain authorization states server-side and sign all session data to prevent tampering. Use cryptography libraries or signed JWT tokens to manage session cookies and CSRF tokens.
Implement resource ownership verification to prevent cross-account vulnerabilities like IDOR. With this practice, only the rightful owner can access or modify their data.
To create an effective, secure, and manageable authorization system, you need to consider several factors.
See an error or have a suggestion? Please let us know by emailing ssg-blogs@splunk.com.
This posting does not necessarily represent Splunk's position, strategies or opinion.
The Splunk platform removes the barriers between data and action, empowering observability, IT and security teams to ensure their organizations are secure, resilient and innovative.
Founded in 2003, Splunk is a global company — with over 7,500 employees, Splunkers have received over 1,020 patents to date and availability in 21 regions around the world — and offers an open, extensible data platform that supports shared data across any environment so that all teams in an organization can get end-to-end visibility, with context, for every interaction and business process. Build a strong data foundation with Splunk.