Commit a450694
2017-11-24 21:44:34
1 parent
e4541e0
Changed files (3)
airport
app
controllers
views
assertions
airport/app/controllers/assertions_controller.rb
@@ -8,7 +8,6 @@ class AssertionsController < ApplicationController
return render :error, status: :forbidden if @saml_response.invalid?
session[@saml_response.issuer] = { id: @saml_response.name_id }.merge(@saml_response.attributes)
- redirect_to registrations_path
end
def destroy
@@ -16,10 +15,9 @@ class AssertionsController < ApplicationController
# IDP initiated logout
elsif params['SAMLResponse'].present?
saml_binding = sp.single_logout_service_for(binding: :http_post)
- saml_response = saml_binding.deserialize(params)
- raise ActiveRecordRecordInvalid.new(saml_response) if saml_response.invalid?
- session[saml_response.issuer] = nil
- redirect_to registrations_path
+ @saml_response = saml_binding.deserialize(params)
+ raise ActiveRecordRecordInvalid.new(@saml_response) if @saml_response.invalid?
+ session[@saml_response.issuer] = nil
end
end
airport/app/views/assertions/create.html.erb
@@ -0,0 +1,17 @@
+<div class="container">
+ <div class="row">
+ <div class="col">
+ <h1>Received Response</h1>
+ <%= render partial: "spinner" %>
+ <%= debug @saml_response.to_xhtml %>
+ </div>
+ </div>
+</div>
+
+<%= javascript_tag do %>
+ window.onload = function(){
+ window.setTimeout(function(){
+ window.location.href = '<%= registrations_path %>';
+ }, 5000);
+ };
+<% end %>
airport/app/views/assertions/destroy.html.erb
@@ -0,0 +1,17 @@
+<div class="container">
+ <div class="row">
+ <div class="col">
+ <h1>Received Response</h1>
+ <%= render partial: "spinner" %>
+ <%= debug @saml_response.to_xhtml %>
+ </div>
+ </div>
+</div>
+
+<%= javascript_tag do %>
+ window.onload = function(){
+ window.setTimeout(function(){
+ window.location.href = '<%= registrations_path %>';
+ }, 5000);
+ };
+<% end %>