Skip to content

Learning Authentication: RBAC, ABAC, OAuth, and OIDC

Published: at 12:00 PM (3 min read)

Learning Authentication: RBAC, ABAC, OAuth, and OIDC

This blog delves into key concepts in authentication and authorization, comparing RBAC and ABAC, explaining OAuth flows, and detailing how OIDC builds upon OAuth for identity management.

RBAC vs ABAC

Role Based Access Control

Access is granted based on predefined roles assigned to users

Core Idea

User -> Role -> Permissions

Role Example

Pros

Cons

Attribute Based Access Control

Access is granted based on attributes and policies.

Core Idea

Access decision = function(user attributes, resource attributes, action, environment)

Attributes Examples

Policy Example

Pros

Cons

OAuth

OAuth is an authentication framework. It’s about giving a third-party app permission to act on your behalf without giving them your password.

OAuth Flow

Authorization

The user logs into Google and gives your app permission

The Code

Googles sends temporary Authorization code to your backend

The Exchange

Your backend sends that code and your client secret (the secret to confirm your server’s identity the request was made from your server)

The Handshake

Google sends 2 important tokens:

How they gain access to your system: Once we have the user’s email from Google, we can check the database:

OIDC

OpenID Connect (OIDC) is an identity layer built on top of OAuth 2.0. OAuth is for Authorization (what you can access) OIDC is fro Authentication (what your identity is) What OIDC adds on Top of OAuth

  1. ID Token (JWT)
  2. UserInfo endpoint
  3. Standard identity scopes (openid, profile, email)
  4. Discovery document
  5. Standardized login flow

How OpenID Connect Work ?

OIDC follows this standarized flow:


Next Post
Learn Node.js