saml-kit 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +5 -0
  5. data/Gemfile +6 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +39 -0
  8. data/Rakefile +6 -0
  9. data/bin/console +14 -0
  10. data/bin/setup +8 -0
  11. data/exe/saml-kit-decode-http-redirect +7 -0
  12. data/lib/saml/kit.rb +60 -0
  13. data/lib/saml/kit/authentication_request.rb +78 -0
  14. data/lib/saml/kit/binding.rb +40 -0
  15. data/lib/saml/kit/configuration.rb +36 -0
  16. data/lib/saml/kit/default_registry.rb +49 -0
  17. data/lib/saml/kit/document.rb +96 -0
  18. data/lib/saml/kit/fingerprint.rb +40 -0
  19. data/lib/saml/kit/http_post_binding.rb +27 -0
  20. data/lib/saml/kit/http_redirect_binding.rb +58 -0
  21. data/lib/saml/kit/identity_provider_metadata.rb +122 -0
  22. data/lib/saml/kit/invalid_document.rb +13 -0
  23. data/lib/saml/kit/locales/en.yml +25 -0
  24. data/lib/saml/kit/logout_request.rb +78 -0
  25. data/lib/saml/kit/logout_response.rb +63 -0
  26. data/lib/saml/kit/metadata.rb +171 -0
  27. data/lib/saml/kit/namespaces.rb +47 -0
  28. data/lib/saml/kit/requestable.rb +14 -0
  29. data/lib/saml/kit/respondable.rb +35 -0
  30. data/lib/saml/kit/response.rb +197 -0
  31. data/lib/saml/kit/self_signed_certificate.rb +30 -0
  32. data/lib/saml/kit/serializable.rb +31 -0
  33. data/lib/saml/kit/service_provider_metadata.rb +99 -0
  34. data/lib/saml/kit/signature.rb +75 -0
  35. data/lib/saml/kit/trustable.rb +62 -0
  36. data/lib/saml/kit/url_builder.rb +38 -0
  37. data/lib/saml/kit/version.rb +5 -0
  38. data/lib/saml/kit/xml.rb +57 -0
  39. data/lib/saml/kit/xsd/MetadataExchange.xsd +95 -0
  40. data/lib/saml/kit/xsd/oasis-200401-wss-wssecurity-secext-1.0.xsd +196 -0
  41. data/lib/saml/kit/xsd/oasis-200401-wss-wssecurity-utility-1.0.xsd +95 -0
  42. data/lib/saml/kit/xsd/saml-schema-assertion-2.0.xsd +283 -0
  43. data/lib/saml/kit/xsd/saml-schema-authn-context-2.0.xsd +23 -0
  44. data/lib/saml/kit/xsd/saml-schema-authn-context-types-2.0.xsd +821 -0
  45. data/lib/saml/kit/xsd/saml-schema-metadata-2.0.xsd +335 -0
  46. data/lib/saml/kit/xsd/saml-schema-protocol-2.0.xsd +302 -0
  47. data/lib/saml/kit/xsd/sstc-metadata-attr.xsd +35 -0
  48. data/lib/saml/kit/xsd/sstc-saml-attribute-ext.xsd +25 -0
  49. data/lib/saml/kit/xsd/sstc-saml-metadata-algsupport-v1.0.xsd +41 -0
  50. data/lib/saml/kit/xsd/sstc-saml-metadata-ui-v1.0.xsd +89 -0
  51. data/lib/saml/kit/xsd/ws-addr.xsd +120 -0
  52. data/lib/saml/kit/xsd/ws-authorization.xsd +145 -0
  53. data/lib/saml/kit/xsd/ws-federation.xsd +471 -0
  54. data/lib/saml/kit/xsd/ws-securitypolicy-1.2.xsd +900 -0
  55. data/lib/saml/kit/xsd/xenc-schema.xsd +136 -0
  56. data/lib/saml/kit/xsd/xml.xsd +287 -0
  57. data/lib/saml/kit/xsd/xmldsig-core-schema.xsd +309 -0
  58. data/lib/saml/kit/xsd_validatable.rb +19 -0
  59. data/saml-kit.gemspec +35 -0
  60. metadata +243 -0
@@ -0,0 +1,75 @@
1
+ module Saml
2
+ module Kit
3
+ class Signature
4
+ SIGNATURE_METHODS = {
5
+ SHA1: "http://www.w3.org/2000/09/xmldsig#rsa-sha1",
6
+ SHA224: "http://www.w3.org/2001/04/xmldsig-more#rsa-sha224",
7
+ SHA256: "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",
8
+ SHA384: "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384",
9
+ SHA512: "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512",
10
+ }.freeze
11
+ DIGEST_METHODS = {
12
+ SHA1: "http://www.w3.org/2000/09/xmldsig#SHA1",
13
+ SHA224: "http://www.w3.org/2001/04/xmldsig-more#sha224",
14
+ SHA256: "http://www.w3.org/2001/04/xmlenc#sha256",
15
+ SHA384: "http://www.w3.org/2001/04/xmldsig-more#sha384",
16
+ SHA512: "http://www.w3.org/2001/04/xmlenc#sha512",
17
+ }.freeze
18
+
19
+ attr_reader :configuration, :reference_id, :sign
20
+
21
+ def initialize(reference_id, configuration: Saml::Kit.configuration, sign: true)
22
+ @reference_id = reference_id
23
+ @configuration = configuration
24
+ @sign = sign
25
+ end
26
+
27
+ def template(xml = ::Builder::XmlMarkup.new)
28
+ return unless sign
29
+ return if reference_id.blank?
30
+
31
+ xml.Signature "xmlns" => Namespaces::XMLDSIG do
32
+ xml.SignedInfo do
33
+ xml.CanonicalizationMethod Algorithm: "http://www.w3.org/2001/10/xml-exc-c14n#"
34
+ xml.SignatureMethod Algorithm: SIGNATURE_METHODS[configuration.signature_method]
35
+ xml.Reference URI: "#_#{reference_id}" do
36
+ xml.Transforms do
37
+ xml.Transform Algorithm: "http://www.w3.org/2000/09/xmldsig#enveloped-signature"
38
+ xml.Transform Algorithm: "http://www.w3.org/2001/10/xml-exc-c14n#"
39
+ end
40
+ xml.DigestMethod Algorithm: DIGEST_METHODS[configuration.digest_method]
41
+ xml.DigestValue ""
42
+ end
43
+ end
44
+ xml.SignatureValue ""
45
+ xml.KeyInfo do
46
+ xml.X509Data do
47
+ xml.X509Certificate configuration.stripped_signing_certificate
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+ def finalize(xml)
54
+ if sign && reference_id.present?
55
+ document = Xmldsig::SignedDocument.new(xml.target!)
56
+ document.sign(private_key)
57
+ else
58
+ xml.target!
59
+ end
60
+ end
61
+
62
+ def self.sign(id, sign: true, xml: ::Builder::XmlMarkup.new)
63
+ signature = new(id, sign: sign)
64
+ yield xml, signature
65
+ signature.finalize(xml)
66
+ end
67
+
68
+ private
69
+
70
+ def private_key
71
+ configuration.signing_private_key
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,62 @@
1
+ module Saml
2
+ module Kit
3
+ module Trustable
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ validate :must_have_valid_signature
8
+ validate :must_be_registered
9
+ end
10
+
11
+ def certificate
12
+ return unless signed?
13
+ to_h.fetch(name, {}).fetch('Signature', {}).fetch('KeyInfo', {}).fetch('X509Data', {}).fetch('X509Certificate', nil)
14
+ end
15
+
16
+ def fingerprint
17
+ return if certificate.blank?
18
+ Fingerprint.new(certificate)
19
+ end
20
+
21
+ def signed?
22
+ to_h[name]['Signature'].present?
23
+ end
24
+
25
+ def trusted?
26
+ return false if provider.nil?
27
+ return false unless signed?
28
+ provider.matches?(fingerprint, use: :signing)
29
+ end
30
+
31
+ def provider
32
+ registry.metadata_for(issuer)
33
+ end
34
+
35
+ def registry
36
+ Saml::Kit.configuration.registry
37
+ end
38
+
39
+ private
40
+
41
+ def must_have_valid_signature
42
+ return if to_xml.blank?
43
+
44
+ xml = Saml::Kit::Xml.new(to_xml)
45
+ xml.valid?
46
+ xml.errors.each do |error|
47
+ errors[:base] << error
48
+ end
49
+ end
50
+
51
+ def must_be_registered
52
+ return unless expected_type?
53
+ if provider.nil?
54
+ errors[:provider] << error_message(:unregistered)
55
+ return
56
+ end
57
+ return if trusted?
58
+ errors[:fingerprint] << error_message(:invalid_fingerprint)
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,38 @@
1
+ module Saml
2
+ module Kit
3
+ class UrlBuilder
4
+ include Serializable
5
+
6
+ def initialize(private_key: Saml::Kit.configuration.signing_private_key)
7
+ @private_key = private_key
8
+ end
9
+
10
+ def build(saml_document, relay_state: nil)
11
+ payload = canonicalize(saml_document, relay_state)
12
+ "#{saml_document.destination}?#{payload}&Signature=#{signature_for(payload)}"
13
+ end
14
+
15
+ private
16
+
17
+ attr_reader :private_key
18
+
19
+ def signature_for(payload)
20
+ encode(private_key.sign(OpenSSL::Digest::SHA256.new, payload))
21
+ end
22
+
23
+ def canonicalize(saml_document, relay_state)
24
+ {
25
+ saml_document.query_string_parameter => serialize(saml_document.to_xml),
26
+ 'RelayState' => relay_state,
27
+ 'SigAlg' => Saml::Kit::Namespaces::SHA256,
28
+ }.map do |(key, value)|
29
+ value.present? ? "#{key}=#{escape(value)}" : nil
30
+ end.compact.join('&')
31
+ end
32
+
33
+ def serialize(value)
34
+ encode(deflate(value))
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,5 @@
1
+ module Saml
2
+ module Kit
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,57 @@
1
+ module Saml
2
+ module Kit
3
+ class Xml
4
+ include ActiveModel::Validations
5
+
6
+ attr_reader :raw_xml, :document
7
+
8
+ validate :validate_signatures
9
+ validate :validate_certificates
10
+
11
+ def initialize(raw_xml)
12
+ @raw_xml = raw_xml
13
+ @document = Nokogiri::XML(raw_xml, nil, nil, Nokogiri::XML::ParseOptions::STRICT) do |config|
14
+ config.noblanks
15
+ end
16
+ end
17
+
18
+ def x509_certificates
19
+ xpath = "//ds:KeyInfo/ds:X509Data/ds:X509Certificate"
20
+ document.search(xpath, Xmldsig::NAMESPACES).map do |item|
21
+ OpenSSL::X509::Certificate.new(Base64.decode64(item.text))
22
+ end
23
+ end
24
+
25
+ private
26
+
27
+ def validate_signatures
28
+ invalid_signatures.flat_map(&:errors).uniq.each do |error|
29
+ errors.add(error, "is invalid")
30
+ end
31
+ end
32
+
33
+ def invalid_signatures
34
+ signed_document = Xmldsig::SignedDocument.new(document, id_attr: 'ID=$uri or @Id')
35
+ signed_document.signatures.find_all do |signature|
36
+ x509_certificates.all? do |certificate|
37
+ !signature.valid?(certificate)
38
+ end
39
+ end
40
+ end
41
+
42
+ def validate_certificates(now = Time.current)
43
+ return unless document.at_xpath('//ds:Signature', Xmldsig::NAMESPACES).present?
44
+
45
+ x509_certificates.each do |certificate|
46
+ if now < certificate.not_before
47
+ errors.add(:certificate, "Not valid before #{certificate.not_before}")
48
+ end
49
+
50
+ if now > certificate.not_after
51
+ errors.add(:certificate, "Not valid after #{certificate.not_after}")
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,95 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+
4
+ (c) 2004-2006 BEA Systems Inc., Computer Associates International, Inc.,
5
+ International Business Machines Corporation, Microsoft Corporation,
6
+ Inc., SAP AG, Sun Microsystems, and webMethods. All rights reserved.
7
+
8
+ Permission to copy and display the WS-MetadataExchange Specification
9
+ (the "Specification"), in any medium without fee or royalty is hereby
10
+ granted, provided that you include the following on ALL copies of the
11
+ Specification that you make:
12
+
13
+ 1. A link or URL to the Specification at this location.
14
+ 2. The copyright notice as shown in the Specification.
15
+
16
+ BEA Systems, Computer Associates, IBM, Microsoft, SAP, Sun, and
17
+ webMethods (collectively, the "Authors") each agree to grant you a
18
+ license, under royalty-free and otherwise reasonable,
19
+ non-discriminatory terms and conditions, to their respective essential
20
+ patent claims that they deem necessary to implement the
21
+ WS-MetadataExchange Specification.
22
+
23
+ THE SPECIFICATION IS PROVIDED "AS IS," AND THE AUTHORS MAKE NO
24
+ REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT
25
+ LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
26
+ PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE
27
+ SPECIFICATION ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE
28
+ IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY
29
+ PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
30
+
31
+ THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
32
+ INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
33
+ USE OR DISTRIBUTION OF THE SPECIFICATIONS.
34
+
35
+ The name and trademarks of the Authors may NOT be used in any manner,
36
+ including advertising or publicity pertaining to the Specifications or
37
+ their contents without specific, written prior permission. Title to
38
+ copyright in the Specifications will at all times remain with the
39
+ Authors.
40
+
41
+ No other rights are granted by implication, estoppel or otherwise.
42
+ -->
43
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsa04="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsa10="http://www.w3.org/2005/08/addressing" targetNamespace="http://schemas.xmlsoap.org/ws/2004/09/mex" elementFormDefault="qualified" blockDefault="#all">
44
+ <!-- Get Metadata request -->
45
+ <xs:element name="GetMetadata">
46
+ <xs:complexType>
47
+ <xs:sequence>
48
+ <xs:element ref="tns:Dialect" minOccurs="0" />
49
+ <xs:element ref="tns:Identifier" minOccurs="0" />
50
+ </xs:sequence>
51
+ <xs:anyAttribute namespace="##other" processContents="lax" />
52
+ </xs:complexType>
53
+ </xs:element>
54
+ <xs:element name="Dialect" type="xs:anyURI" />
55
+ <xs:element name="Identifier" type="xs:anyURI" />
56
+ <!-- Get Metadata response -->
57
+ <xs:element name="Metadata">
58
+ <xs:complexType>
59
+ <xs:sequence>
60
+ <xs:element ref="tns:MetadataSection" minOccurs="0" maxOccurs="unbounded" />
61
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
62
+ </xs:sequence>
63
+ <xs:anyAttribute namespace="##other" processContents="lax" />
64
+ </xs:complexType>
65
+ </xs:element>
66
+ <xs:element name="MetadataSection">
67
+ <xs:complexType>
68
+ <xs:choice>
69
+ <xs:any namespace="##other" processContents="lax" />
70
+ <xs:element ref="tns:MetadataReference" />
71
+ <xs:element ref="tns:Location" />
72
+ </xs:choice>
73
+ <xs:attribute name="Dialect" type="xs:anyURI" use="required" />
74
+ <xs:attribute name="Identifier" type="xs:anyURI" />
75
+ <xs:anyAttribute namespace="##other" processContents="lax" />
76
+ </xs:complexType>
77
+ </xs:element>
78
+ <!--
79
+
80
+ Ideally, the type of the MetadataReference would have been
81
+ the union of wsa04:EndpointReferenceType and
82
+ wsa10:EndpointReferenceType but unfortunately xs:union only
83
+ works for simple types. As a result, we have to define
84
+ the mex:MetadataReference using xs:any.
85
+
86
+ -->
87
+ <xs:element name="MetadataReference">
88
+ <xs:complexType>
89
+ <xs:sequence>
90
+ <xs:any minOccurs="1" maxOccurs="unbounded" processContents="lax" namespace="##other" />
91
+ </xs:sequence>
92
+ </xs:complexType>
93
+ </xs:element>
94
+ <xs:element name="Location" type="xs:anyURI" />
95
+ </xs:schema>
@@ -0,0 +1,196 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+
4
+ OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS's procedures with respect to rights in OASIS specifications can be found at the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification, can be obtained from the OASIS Executive Director.
5
+ OASIS invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to implement this specification. Please address the information to the OASIS Executive Director.
6
+ Copyright © OASIS Open 2002-2004. All Rights Reserved.
7
+ This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself does not be modified in any way, such as by removing the copyright notice or references to OASIS, except as needed for the purpose of developing OASIS specifications, in which case the procedures for copyrights defined in the OASIS Intellectual Property Rights document must be followed, or as required to translate it into languages other than English.
8
+ The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.
9
+ This document and the information contained herein is provided on an “AS IS” basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
10
+ -->
11
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" targetNamespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" elementFormDefault="qualified" attributeFormDefault="unqualified" blockDefault="#all" version="0.2">
12
+ <xsd:import namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" schemaLocation="oasis-200401-wss-wssecurity-utility-1.0.xsd" />
13
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd" />
14
+ <xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd" />
15
+ <xsd:complexType name="AttributedString">
16
+ <xsd:annotation>
17
+ <xsd:documentation>This type represents an element with arbitrary attributes.</xsd:documentation>
18
+ </xsd:annotation>
19
+ <xsd:simpleContent>
20
+ <xsd:extension base="xsd:string">
21
+ <xsd:attribute ref="wsu:Id" />
22
+ <xsd:anyAttribute namespace="##other" processContents="lax" />
23
+ </xsd:extension>
24
+ </xsd:simpleContent>
25
+ </xsd:complexType>
26
+ <xsd:complexType name="PasswordString">
27
+ <xsd:annotation>
28
+ <xsd:documentation>This type is used for password elements per Section 4.1.</xsd:documentation>
29
+ </xsd:annotation>
30
+ <xsd:simpleContent>
31
+ <xsd:extension base="wsse:AttributedString">
32
+ <xsd:attribute name="Type" type="xsd:anyURI" />
33
+ </xsd:extension>
34
+ </xsd:simpleContent>
35
+ </xsd:complexType>
36
+ <xsd:complexType name="EncodedString">
37
+ <xsd:annotation>
38
+ <xsd:documentation>This type is used for elements containing stringified binary data.</xsd:documentation>
39
+ </xsd:annotation>
40
+ <xsd:simpleContent>
41
+ <xsd:extension base="wsse:AttributedString">
42
+ <xsd:attribute name="EncodingType" type="xsd:anyURI" />
43
+ </xsd:extension>
44
+ </xsd:simpleContent>
45
+ </xsd:complexType>
46
+ <xsd:complexType name="UsernameTokenType">
47
+ <xsd:annotation>
48
+ <xsd:documentation>This type represents a username token per Section 4.1</xsd:documentation>
49
+ </xsd:annotation>
50
+ <xsd:sequence>
51
+ <xsd:element name="Username" type="wsse:AttributedString" />
52
+ <xsd:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
53
+ </xsd:sequence>
54
+ <xsd:attribute ref="wsu:Id" />
55
+ <xsd:anyAttribute namespace="##other" processContents="lax" />
56
+ </xsd:complexType>
57
+ <xsd:complexType name="BinarySecurityTokenType">
58
+ <xsd:annotation>
59
+ <xsd:documentation>A security token that is encoded in binary</xsd:documentation>
60
+ </xsd:annotation>
61
+ <xsd:simpleContent>
62
+ <xsd:extension base="wsse:EncodedString">
63
+ <xsd:attribute name="ValueType" type="xsd:anyURI" />
64
+ </xsd:extension>
65
+ </xsd:simpleContent>
66
+ </xsd:complexType>
67
+ <xsd:complexType name="KeyIdentifierType">
68
+ <xsd:annotation>
69
+ <xsd:documentation>A security token key identifier</xsd:documentation>
70
+ </xsd:annotation>
71
+ <xsd:simpleContent>
72
+ <xsd:extension base="wsse:EncodedString">
73
+ <xsd:attribute name="ValueType" type="xsd:anyURI" />
74
+ </xsd:extension>
75
+ </xsd:simpleContent>
76
+ </xsd:complexType>
77
+ <xsd:simpleType name="tUsage">
78
+ <xsd:annotation>
79
+ <xsd:documentation>Typedef to allow a list of usages (as URIs).</xsd:documentation>
80
+ </xsd:annotation>
81
+ <xsd:list itemType="xsd:anyURI" />
82
+ </xsd:simpleType>
83
+ <xsd:attribute name="Usage" type="tUsage">
84
+ <xsd:annotation>
85
+ <xsd:documentation>This global attribute is used to indicate the usage of a referenced or indicated token within the containing context</xsd:documentation>
86
+ </xsd:annotation>
87
+ </xsd:attribute>
88
+ <xsd:complexType name="ReferenceType">
89
+ <xsd:annotation>
90
+ <xsd:documentation>This type represents a reference to an external security token.</xsd:documentation>
91
+ </xsd:annotation>
92
+ <xsd:attribute name="URI" type="xsd:anyURI" />
93
+ <xsd:attribute name="ValueType" type="xsd:anyURI" />
94
+ <xsd:anyAttribute namespace="##other" processContents="lax" />
95
+ </xsd:complexType>
96
+ <xsd:complexType name="EmbeddedType">
97
+ <xsd:annotation>
98
+ <xsd:documentation>This type represents a reference to an embedded security token.</xsd:documentation>
99
+ </xsd:annotation>
100
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
101
+ <xsd:any processContents="lax" />
102
+ </xsd:choice>
103
+ <xsd:attribute name="ValueType" type="xsd:anyURI" />
104
+ <xsd:anyAttribute namespace="##other" processContents="lax" />
105
+ </xsd:complexType>
106
+ <xsd:complexType name="SecurityTokenReferenceType">
107
+ <xsd:annotation>
108
+ <xsd:documentation>This type is used reference a security token.</xsd:documentation>
109
+ </xsd:annotation>
110
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
111
+ <xsd:any processContents="lax" />
112
+ </xsd:choice>
113
+ <xsd:attribute ref="wsu:Id" />
114
+ <xsd:attribute ref="wsse:Usage" />
115
+ <xsd:anyAttribute namespace="##other" processContents="lax" />
116
+ </xsd:complexType>
117
+ <xsd:complexType name="SecurityHeaderType">
118
+ <xsd:annotation>
119
+ <xsd:documentation>This complexType defines header block to use for security-relevant data directed at a specific SOAP actor.</xsd:documentation>
120
+ </xsd:annotation>
121
+ <xsd:sequence>
122
+ <xsd:any processContents="lax" minOccurs="0" maxOccurs="unbounded">
123
+ <xsd:annotation>
124
+ <xsd:documentation>The use of "any" is to allow extensibility and different forms of security data.</xsd:documentation>
125
+ </xsd:annotation>
126
+ </xsd:any>
127
+ </xsd:sequence>
128
+ <xsd:anyAttribute namespace="##other" processContents="lax" />
129
+ </xsd:complexType>
130
+ <xsd:complexType name="TransformationParametersType">
131
+ <xsd:annotation>
132
+ <xsd:documentation>This complexType defines a container for elements to be specified from any namespace as properties/parameters of a DSIG transformation.</xsd:documentation>
133
+ </xsd:annotation>
134
+ <xsd:sequence>
135
+ <xsd:any processContents="lax" minOccurs="0" maxOccurs="unbounded">
136
+ <xsd:annotation>
137
+ <xsd:documentation>The use of "any" is to allow extensibility from any namespace.</xsd:documentation>
138
+ </xsd:annotation>
139
+ </xsd:any>
140
+ </xsd:sequence>
141
+ <xsd:anyAttribute namespace="##other" processContents="lax" />
142
+ </xsd:complexType>
143
+ <xsd:element name="UsernameToken" type="wsse:UsernameTokenType">
144
+ <xsd:annotation>
145
+ <xsd:documentation>This element defines the wsse:UsernameToken element per Section 4.1.</xsd:documentation>
146
+ </xsd:annotation>
147
+ </xsd:element>
148
+ <xsd:element name="BinarySecurityToken" type="wsse:BinarySecurityTokenType">
149
+ <xsd:annotation>
150
+ <xsd:documentation>This element defines the wsse:BinarySecurityToken element per Section 4.2.</xsd:documentation>
151
+ </xsd:annotation>
152
+ </xsd:element>
153
+ <xsd:element name="Reference" type="wsse:ReferenceType">
154
+ <xsd:annotation>
155
+ <xsd:documentation>This element defines a security token reference</xsd:documentation>
156
+ </xsd:annotation>
157
+ </xsd:element>
158
+ <xsd:element name="Embedded" type="wsse:EmbeddedType">
159
+ <xsd:annotation>
160
+ <xsd:documentation>This element defines a security token embedded reference</xsd:documentation>
161
+ </xsd:annotation>
162
+ </xsd:element>
163
+ <xsd:element name="KeyIdentifier" type="wsse:KeyIdentifierType">
164
+ <xsd:annotation>
165
+ <xsd:documentation>This element defines a key identifier reference</xsd:documentation>
166
+ </xsd:annotation>
167
+ </xsd:element>
168
+ <xsd:element name="SecurityTokenReference" type="wsse:SecurityTokenReferenceType">
169
+ <xsd:annotation>
170
+ <xsd:documentation>This element defines the wsse:SecurityTokenReference per Section 4.3.</xsd:documentation>
171
+ </xsd:annotation>
172
+ </xsd:element>
173
+ <xsd:element name="Security" type="wsse:SecurityHeaderType">
174
+ <xsd:annotation>
175
+ <xsd:documentation>This element defines the wsse:Security SOAP header element per Section 4.</xsd:documentation>
176
+ </xsd:annotation>
177
+ </xsd:element>
178
+ <xsd:element name="TransformationParameters" type="wsse:TransformationParametersType">
179
+ <xsd:annotation>
180
+ <xsd:documentation>This element contains properties for transformations from any namespace, including DSIG.</xsd:documentation>
181
+ </xsd:annotation>
182
+ </xsd:element>
183
+ <xsd:element name="Password" type="wsse:PasswordString" />
184
+ <xsd:element name="Nonce" type="wsse:EncodedString" />
185
+ <xsd:simpleType name="FaultcodeEnum">
186
+ <xsd:restriction base="xsd:QName">
187
+ <xsd:enumeration value="wsse:UnsupportedSecurityToken" />
188
+ <xsd:enumeration value="wsse:UnsupportedAlgorithm" />
189
+ <xsd:enumeration value="wsse:InvalidSecurity" />
190
+ <xsd:enumeration value="wsse:InvalidSecurityToken" />
191
+ <xsd:enumeration value="wsse:FailedAuthentication" />
192
+ <xsd:enumeration value="wsse:FailedCheck" />
193
+ <xsd:enumeration value="wsse:SecurityTokenUnavailable" />
194
+ </xsd:restriction>
195
+ </xsd:simpleType>
196
+ </xsd:schema>