2017-09-29 18 views
0

AuthNRequest sampleonelogin:なぜRequestedAuthnContextが必要ですか?

<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="ONELOGIN_809707f0030a5d00620c9d9df97f627afe9dcc24" Version="2.0" ProviderName="SP test" IssueInstant="2014-07-16T23:52:45Z" Destination="http://idp.example.com/SSOService.php" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="http://sp.example.com/demo1/index.php?acs"> 
    <saml:Issuer>http://sp.example.com/demo1/metadata.php</saml:Issuer> 
    <samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" AllowCreate="true"/> 
    <samlp:RequestedAuthnContext Comparison="exact"> 
    <saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef> 
    </samlp:RequestedAuthnContext> 
</samlp:AuthnRequest> 

を取るには、Validate XML with the XSD schemaにそれを入れて、XSD(スキーマファイル)ため のAuthnRequestを選択してください。

これは妥当性が確認されています。今すぐRequestedAuthnContext要素を取り出して、検証は次のように失敗します。 このXMLの無効なXSD

URNためグーグル:オアシス:名:TC:SAML:2.0:プロトコル I複数のインスタンスSAMLスキーマ・プロトコル2.0.xsd including this oneの 見つけます。

質問1)

が、私はこのXMLため無効なXSDを取得しないので:

<element name="RequestedAuthnContext" type="samlp:RequestedAuthnContextType"/> 

持っていません。

minOccurs="0" 

質問2)

セクション3.4.1要素saml-core-2.0-os.pdfを見ると、それは言う:

<RequestedAuthnContext> [Optional] 

が間違っているの.xsdですか?おかげさまで

答えて

1

検証ツールは、内部のphp-SAMLおよびXMLを検証するために使用するXSDを使用していること:https://github.com/onelogin/php-saml/blob/master/lib/Saml2/schemas/saml-schema-protocol-2.0.xsd#L114

あなたはそれを使用して見ることができます:

とのminOccursに

を欠いそして、あなたは正しいです。有効なAuthNRequestがその要素を省略できるので、間違っているようです。

参考:http://www.datypic.com/sc/saml2/e-samlp_AuthnRequest.html

私はそれを

を修正します
関連する問題