-
Notifications
You must be signed in to change notification settings - Fork 15
/
test.rb
18 lines (15 loc) · 15.9 KB
/
test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'saml'
saml_response = "PHNhbWxwOlJlc3BvbnNlIElEPSJfNjI0N2E2NDMtMjg5Yy00NDJmLTkwNWYtMGNkZWZlYTg4MjZlIiBWZXJzaW9uPSIyLjAiIElzc3VlSW5zdGFudD0iMjAxNi0wMS0wN1QxODoyOTo1OC43NFoiIERlc3RpbmF0aW9uPSJodHRwczovL3FhMi5oZWFsdGh0YXAuY29tL3Nzby9zZXNzaW9ucy9hc3NlcnRpb25fY29uc3VtZXJfc2VydmljZSIgQ29uc2VudD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmNvbnNlbnQ6dW5zcGVjaWZpZWQiIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiPjxzYW1sOklzc3VlciB4bWxuczpzYW1sPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXNzZXJ0aW9uIj50ZXN0LmhlYWx0aGVxdWl0eS5jb20uc2FtbDI8L3NhbWw6SXNzdWVyPjxzYW1scDpTdGF0dXM+PHNhbWxwOlN0YXR1c0NvZGUgVmFsdWU9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpzdGF0dXM6U3VjY2VzcyIgLz48L3NhbWxwOlN0YXR1cz48c2FtbDpFbmNyeXB0ZWRBc3NlcnRpb24geG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiI+PEVuY3J5cHRlZERhdGEgVHlwZT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS8wNC94bWxlbmMjRWxlbWVudCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvMDQveG1sZW5jIyI+PEVuY3J5cHRpb25NZXRob2QgQWxnb3JpdGhtP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wVR7S0/8YApp4KVwfr3NuEiv5NxJ0hNcXcgPnOZtA29\nWvdtAoIBADLTdnNZKvNy0ijJeUQPa8YuRAlAdKuGk+VuH8v+DJsa1jvGwL3/RizX\nst/G9bOQGKsyj/gqeWXgwCezmiEqPMnu6h7bAV1qKn+b/iJoDqqsI56tJVVQEnII\n9nf0v65xQERWdJhviJcD4u1/DJuUWa/rBzPmAprm+hUGyF/4gMIDLoIhKD4DIm8j\ny1RgAwidRxHtrl6PlvW7F8YJZDHOPJUF33U3byvatkm+3RXvJrmVR2o4UTKnBimi\nhT/hDcKkIelQUvtqxv9oSh/uEfPDIfzZnjXoEy25/8g56gfYZreTSQbT5naIV+77\nfh93Qb7sSLjhoxvmssx52BcAC9efoKcCggEALxwMF5eTE99p/xw4cTkJKMeZVwfX\nfpma1yU4iN14rK0HFxFvOos6YDuIg4oG/OQF2ABYcTkxvVg4N2Y1mrKP9Cr7Qa52\nrHuk3Di+opJuQXkccBWM68xprgp6Www9J6bJPRqOdiIrMxSwWJ/29pQg2iH2ms9T\nsWDprNJs7w4YUzQCGzna9KGLXSCAs2Ax6OwcyjshMG11aS47mPkeSTJC/+Wf9MJn\naSEx+UhZfWHn/CAlR+Jq7yMnt9V1WFzYDflH1uo+ACLoFoNzQKj8fgaqMMCB+OP6\n+ITyWq0fqASSzz/oni9gD/m7Xe+zGuHJwHJw/m68HdwSwuwL5Y/+enUvVg==\n-----END RSA PRIVATE KEY-----\n"
# our code
message = Saml::Encoding.decode_64( saml_response )
request_or_response = Saml.parse_message(message, :response)
assertion = Saml::Util.decrypt_assertion(request_or_response.encrypted_assertion, OpenSSL::PKey::RSA.new(private_key_str)) #this line raise error
puts assertion.to_xml
# One login code that works
require 'onelogin/ruby-saml'
saml_settings = OneLogin::RubySaml::Settings.new({:private_key => private_key_str })
response = OneLogin::RubySaml::Response.new( saml_response, :settings => saml_settings)
request_or_response = Saml.parse_message( response.decrypted_document.to_s, :response)
puts request_or_response.assertion.to_xml