[ SRE_ARENA ]
AUTHENTICATION & AUTHORIZATION

Identity is the New Perimeter

Visualization: 1. OAuth 2.0 (Authorization Code Flow)
DOWNLOADING CONCEPT: 1. OAUTH 2.0 (AUTHORIZATION CODE FLOW)...
OAuth 2.0
  • ↳is the industry standard for Authorization (What can you do?).
  • ↳The most common flow is the Authorization Code Flow used by web apps.
  • ↳1. 302 Redirect: The app redirects the user to the Auth Server (Okta/GitHub).
  • ↳2. Login: The user authenticates directly with Okta.
  • ↳3. 302 Redirect (Auth Code): Okta redirects the user back to the app with a temporary code.
  • ↳4. 200 OK (Token Exchange): The App securely trades the code for an Access Token via a backend API call.
  • ↳5. 200 OK (API Request): The App passes the token as an Authorization: Bearer <token> header to the API.
Common Status Codes
  • ↳- 401 Unauthorized: You didn't provide a token, or it's expired.
  • ↳- 403 Forbidden: You provided a valid token, but you don't have the required scopes to access this resource.
  • ↳- 400 Bad Request: The App sent a malformed request to the Auth Server (e.g., mismatched redirect_uri).
▲ LIVE INCIDENTA developer is getting a 401 Unauthorized from the API, but they swear they passed the token.
sre@arena:~/security-identity
sre@arena:~$ echo $JWT | jq -R 'split(".") | .[1] | @base64d | fromjson'