2013-03-11 68 views
6

OAuth2 SAML bearer spec描述了應用程序如何向令牌端點提供斷言,作爲授權許可。例如,Salesforce's API允許這種方法使應用程序能夠爲用戶帳戶自動請求訪問令牌(只要用戶已經授予此權限,即可)。OAuth2 SAML授權許可中SubjectConfirmation的含義是什麼?

雖然我很難理解斷言的含義。其中大部分都很清楚,例如

  • Issuer是生成(和簽名)斷言
  • Subject是其帳戶被請求的訪問令牌
  • AudienceRestriction用戶限制了觀衆的令牌端點的一方。

但我無法理解的含義是:

  • AuthnStatement - 我從SAML規範的理解是,這一說法的發行人作出聲明,它(發行人)已認證該主題。這是正確的嗎?

  • SubjectConfirmation - 誰在確認這是什麼? SAML規範有助於說明此元素「允許確認主題的信息」。但什麼是確認?誰來執行它,以及如何,何時以及爲了什麼目的?

回答

3

AuthnStatement元素描述身份提供者身份驗證的行爲。 如果斷言頒發者對主體進行了身份驗證,斷言應該包含表示該身份驗證事件的單個身份。

實施例:

<AuthnStatement AuthnInstant="2010-10-01T20:07:34.371Z"> 
      <AuthnContext> 
       <AuthnContextClassRef> 
    <!--Authentication method, was the client authenticated with digital cert, password, kerberos token?--> 
       urn:oasis:names:tc:SAML:2.0:ac:classes:X509 

<!--For example, the Password class is applicable when a principal authenticates to an authentication authority through the presentation of a password over an unprotected HTTP session. --> 
       urn:oasis:names:tc:SAML:2.0:ac:classes:Password 

       urn:oasis:names:tc:SAML:2.0:ac:classes:Kerberos 

       </AuthnContextClassRef> 
      </AuthnContext> 
      </AuthnStatement> 

SubjectConfirmation元件允許授權服務器以確認其作爲承載斷言。這樣的元素必須具有值爲「urn:oasis:names:tc:SAML:2.0:cm:bearer」的Method屬性。 SubjectConfirmation元素必須包含一個SubjectConfirmationData元素(帶有例外),用於指示授權服務器的令牌端點URL。授權服務器必須驗證收件人屬性的值是否與傳遞斷言的令牌端點URL匹配。

例子:

 <saml:SubjectConfirmation> 
<!-- Mandatory --> 
     Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"> 
     <saml:SubjectConfirmationData> 
<!-- The AuthRequest sent this ID --> 
     InResponseTo="aaf23196-1773-2113-474a-fe114412ab72" 
<!-- It was through HTTP POTS token endpoint URL --> 
     Recipient="https://sp.example.com/SAML2/SSO/POST" 
<!-- Not valid ON or After this Date--> 
     NotOnOrAfter="2004-12-05T09:27:05"/> 
    </saml:SubjectConfirmation> 
0

是的,AuthnStatement從這一說法,指出它已經認證了主體的發行人。

SubjectConfirmation說明了想要依賴斷言的實體如何確認所討論的主題是在此斷言中引用的主題。也許這個斷言是有效的,但是對於提出請求的用戶來說呢?如果方法是持有人,那麼任何可以在NotOnOrAfter之前將該斷言提交給在Recipient中引用的端點的被確認。如果方法是鑰匙持有人,那麼只有一個可以證明擁有由嵌套的KeyInfo元素引用的鑰匙的主體得到確認。