ใ‚†ใ‚‹ใƒ†ใƒƒใ‚ฏใƒŽใƒผใƒˆ

What is SAML?

SAML (Security Assertion Markup Language) is an XML-based protocol that enables single sign-on (SSO) between systems. This document provides a casual overview of how SAML works, including its structure and communication flow.

๐Ÿ” Overview of SAML

SAML enables secure login between systems by exchanging authentication data called assertions.

Key Components

  • ๐Ÿ“Œ IdP (Identity Provider): Handles the actual login and authenticates the user.
  • ๐Ÿ“Œ SP (Service Provider): The web service or app the user wants to access.
  • ๐Ÿ“Œ Assertion: An XML document that conveys the authentication result from the IdP.

๐Ÿ” SAML Communication Flow

SAML flows through the browser between SP and IdP using SAMLRequest and SAMLResponse messages.

Main Steps

  • โžก๏ธ User accesses the SP (e.g., internal portal).
  • โžก๏ธ SP generates a SAMLRequest and redirects the user to the IdP.
  • โžก๏ธ User logs in to the IdP.
  • โžก๏ธ IdP generates a SAMLResponse and sends it back to the SP via browser.
  • โžก๏ธ SP verifies the SAMLResponse and logs the user in.

๐Ÿ“จ SAMLRequest and SAMLResponse

Both SAMLRequest and SAMLResponse are encoded XML messages exchanged via browser.

Format Overview

  • ๐Ÿ” SAMLRequest: Sent from SP to IdP, can be sent via Redirect or POST.
  • ๐Ÿ” SAMLResponse: Sent from IdP to SP, usually signed for security.
  • ๐Ÿ” Both are Base64-encoded XML strings.

๐ŸŒ Where SAML is Used

Common Use Cases

  • โœ… Single sign-on between internal systems and cloud apps.
  • โœ… Connecting Google Workspace or Microsoft 365 to external tools.
  • โœ… Sharing login sessions across multiple services.