SAML 2.0 (Security Assertion Markup Language)(サムル2.0)
OASIS 2005年3月標準化のXML ベース認証 / 認可マークアップ言語。エンタープライズSSO の伝統的標準、Microsoft AD FS / Okta / OneLogin 等で広範採用。
概要
SAML 2.0 (Security Assertion Markup Language version 2.0) はOASIS (Organization for the Advancement of Structured Information Standards) が2005年3月15日に標準化したXML ベースの認証 / 認可主張 (Assertion) 交換プロトコル。IdP (Identity Provider・認証主体) と SP (Service Provider・利用先サービス) 間のSSO (Single Sign-On) 実装に使われる伝統的エンタープライズ標準、Microsoft Active Directory Federation Services / Okta / OneLogin / Ping Identity 等のエンタープライズ製品で広範採用。
SAML 2.0 主要マイルストーン
| 年月 | 出来事 |
|---|---|
| 2002 | SAML 1.0 (OASIS) |
| 2003 | SAML 1.1 |
| 2005-03-15 | SAML 2.0 標準化 (RAS Shibboleth と統合) |
| 2010s | エンタープライズSSO 標準化 |
| 2012-2014 | OAuth 2.0 / OIDC 台頭で競合 |
| 2024 | 依然エンタープライズで主流 |
SAML SSO Flow (SP-Initiated)
1. ユーザ → SP: アプリにアクセス
2. SP: SAML AuthnRequest 生成 → ブラウザ経由でIdP へ
3. ブラウザ → IdP: AuthnRequest 送信
4. IdP: ユーザ未認証 → ログイン画面表示
5. ユーザ: 認証 (パスワード / MFA)
6. IdP: SAML Response (Assertion 含) 生成 → ブラウザ経由でSP
7. ブラウザ → SP: SAML Response POST
8. SP: 署名検証 → Session 確立 → アプリ表示
「Federation」(連邦) と呼ばれる仕組み・1つのIdP で複数のSP に SSO 可。
SAML Assertion 構造 (XML)
<saml:Assertion ID="..." IssueInstant="2024-12-15T10:00:00Z">
<saml:Issuer>https://idp.example.com/saml</saml:Issuer>
<ds:Signature>...</ds:Signature>
<saml:Subject>
<saml:NameID Format="...">[email protected]</saml:NameID>
<saml:SubjectConfirmation>...</saml:SubjectConfirmation>
</saml:Subject>
<saml:Conditions NotBefore="..." NotOnOrAfter="...">
<saml:AudienceRestriction>
<saml:Audience>https://sp.example.com</saml:Audience>
</saml:AudienceRestriction>
</saml:Conditions>
<saml:AuthnStatement AuthnInstant="...">
<saml:AuthnContext>
<saml:AuthnContextClassRef>
urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
</saml:AuthnContextClassRef>
</saml:AuthnContext>
</saml:AuthnStatement>
<saml:AttributeStatement>
<saml:Attribute Name="email">
<saml:AttributeValue>[email protected]</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="role">
<saml:AttributeValue>admin</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
</saml:Assertion>
XML SOAP 風で複雑だが、RSA 署名で改竄不可・全Assertion 内容 (ユーザ情報 + 属性 + Authentication Context) をSP 側で利用可。
SAML vs OAuth 2.0 / OIDC
| 項目 | SAML 2.0 | OAuth 2.0 / OIDC |
|---|---|---|
| 公開 | 2005 | 2012 / 2014 |
| Token形式 | XML Assertion (数KB) | JWT (数百Byte) |
| 暗号 | XML Signature (RSA-SHA1/256) | JWS (RSA / EC / HMAC) |
| バインディング | HTTP-POST / Redirect | HTTP Redirect + JSON |
| Mobile対応 | 困難 | 容易 |
| エンタープライズ | ◎ (Microsoft / Okta / SAP / Salesforce) | ◯ |
| Web API | △ | ◎ |
| 学習曲線 | 高 (XML / SOAP) | 中 (REST / JSON) |
| 採用率 (2024) | 30% (大企業) | 70% (主流) |
主要採用先
| サービス | 用途 |
|---|---|
| Microsoft AD FS | エンタープライズSSO |
| Okta | クラウドIDaaS |
| OneLogin | クラウドIDaaS |
| Ping Identity | エンタープライズ |
| Salesforce | SaaS SSO |
| Workday | HR管理 |
| SAP SuccessFactors | HR |
| ServiceNow | ITSM |
| Box / Dropbox Business | クラウドストレージ |
| Slack Enterprise Grid | チーム |
| Google Workspace Enterprise | SAML 経由Federation |
衰退と継続採用
OAuth 2.0 / OIDC (2012-2014) 台頭でSAML 衰退傾向だが:
- エンタープライズの既存システム互換 (10-20年運用)
- 金融 / 医療 / 政府等の規制業界 (CISA / FedRAMP)
- 「複雑だが安全」の評価
- AD / LDAP 統合の伝統
新規実装は OIDC 推奨だが、既存大企業は SAML 継続が一般。
関連用語との違い
- vs OAuth 2.0 / OIDC: 旧 / 新・XML / JSON
- vs LDAP: 配信プロトコル / ディレクトリ
- vs Kerberos: Web / イントラネット
FAQ
Q1: 新規実装で? A: 推奨しない。OAuth 2.0 + OIDC が現代標準・SAML は既存システム連携時のみ。学習コストもOIDC が圧倒的低い。
Q2: SAML 終焉? A: 当面継続。エンタープライズ既存システム互換性で2030年代まで使われ続ける見込み。
Q3: SAML + OIDC 両対応IdP? A: Okta / Auth0 / Ping Identity / Azure AD / OneLogin 全て両対応・「Bridge」(SAML→OIDC 変換) も多い。