GET request being blocked by iframe

I recently encountered a problem with my hosted payment page that is loaded within an iframe.

After the transaction is complete, the payment provider attempts to use a URL specified by us in the iframe to navigate away from it and perform any necessary actions. However, I am struggling to understand why this process is not working as expected.

https://i.sstatic.net/vBl8n.png

Upon completion of the transaction, the payment provider inside the iframe tries to send a request to our designated URL. Unfortunately, the request is cancelled due to the following error:

Mixed Content: The page at '..........' was loaded over HTTPS, but requested an insecure form action ''. This request has been blocked; the content must be served over HTTPS.

Although I suspect that the issue may be related to the iframe, I am unsure of the exact meaning of this error or how to resolve it.

For your information, this occurred in the Chrome browser.

Answer №1

After spending some time on it, I finally cracked the code.

With Spring MVC in play, there are interceptors for spring security that handle requests for both HTTP and HTTPS.

Upon adding a new controller to manage requests from a specific URL set up for our payment provider response, I realized that it lacked configuration in the spring security xml file.

All it took was adding the necessary configuration in the spring security xml file for the designated URL. That simple adjustment allowed us to effectively use the HTTPS URL, resolving the Mixed Content issue we were facing.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How come querySelector is effective while $() or document.getElementById do not respond properly with checkboxes?

Lynda.com's "Jquery Essential Training" course includes an assignment to create checkboxes that show and hide items with a specific data attribute based on whether they are checked or not. document.querySelector('#vitamincheck').addEventLis ...

Finding elements based on their position using Javascript

I'm searching for an optimal method to identify all elements located within a specific range of pixels from the top of the page. Currently, I have implemented a straightforward test called inRange function inRange(el, from, to) { var top = el.offs ...

Error: The "res.json" method is not defined in CustomerComponent

FetchData(){ this.http.get("http://localhost:3000/Customers") .subscribe(data=>this.OnSuccess(data),data=>this.OnError(data)); } OnError(data:any){ console.debug(data.json()); } OnSuccess(data:any){ this.FetchData(); } SuccessGe ...

Is this accessible within a function?

When attempting to pass a reference to a class through to a method in order to access a variable, I encountered a few issues: My initial attempt looked like this: p.id = 1; p._initEvents = function(){ $('#file-form').on('valid.fndtn.ab ...

Tips for incorporating flow and TypeScript typings into an NPM module

Are there any resources available for adding both flow and typescript typings to an NPM module at the same time? I've been struggling to find a comprehensive guide on this topic, and it seems to be a common issue faced by open source library maintain ...

How can I show the total of individual columns from a SQL database in a Java application?

I am facing an issue with retrieving the 'quantity' amount from my database and displaying it in my java application. Despite my attempts to print out the quantity, I always end up running into errors where the catch block is executed rather than ...

Utilize jQuery's .append() function to dynamically insert content into your webpage

I currently have tab elements set up like this: <div class="tab-pane fade active in" id="tab-a"> </div> To populate the content of that tab with a JavaScript string array, I am using the following code snippet: var full_list = ""; for (var ...

Do I need to have Java installed to initiate webdriver-manager?

Every time I try to run webdriver-manager start, I get an error message that says "Selenium Standalone server encountered an error: Error: spawn java ENOENT." Do I need to install Java? If so, how can I do this on a Chromebook running Crostini? I would gr ...

Adding a key and value to a nested JSON object in Java

Given three inputs, I have a JSON object (nested), a node structure, and a key value pair. My task is to append the key value pair to a node by analyzing the node structure and updating the original JSON. For instance, if the inputs are: JSON Objec ...

Tips for incorporating routes in Polka.js in a way that resembles the functionality of express.Route()

One of the challenges I am facing is trying to import route logic from another file in my project. While using Express.js, this could be done easily with express.Route(). However, when attempting polka.Route(), an error occurs stating that Route doesn&apos ...

Generate available choices for an asp:DropDownList using JavaScript without relying on the client-side ID

Can options be populated in an asp:DropDownList using JavaScript without the need for getElementById? I prefer a selector that utilizes classes. Appreciate any assistance. Goodbye. ...

Looping through Java with nested if conditions

I am facing difficulty in identifying the issue with my code. I have two array lists - one for employees and another for assignments. My objective is to add only those employees to availableEmpAry whose skill array contains all required skills and are avai ...

Adding an element to the second-to-last position in a list

In the context of a HTML unordered list <ul id = "master_key_list"> <li id="master_key_23" class="available_element">Fix the Peanut Butter</li> <li id="master_key_24" class="available_element">Focus on Price Sensitivity</li& ...

A guide to displaying JSON information within a data list element (dl)

I am facing an issue while trying to iterate through a multidimensional json data array. Each time I loop through the array, only the last element gets printed. var data = [ [{ "id": "67", "name": "Baby & Toddler Clothing ...

Utilizing Java Stream API to merge entity objects via foreign keys

I've been training to use the Java Steam API and have implemented what was mentioned in the title. However, I am not satisfied with my code. For instance, I have three entity classes that are simple immutable beans. MY CODE: public class Country ...

"Manipulating Arrays in JavaScript: Adding an Item at a Specific

I can easily insert into an array at a specific index when that index already exists. For example, if we have arr = [1, 2, 3, 4] and execute arr.splice(2, 0, 0), the result will be [1, 2, 0, 3, 4]. But what if I have an empty array that needs to be filled ...

Issue occurred while trying to set the value from an API call response in the componentDidMount lifecycle method

There is a boolean variable disableButton: boolean; that needs to be set based on the response received from this API call: async getDocStatus(policy: string): Promise<boolean> { return await ApiService.getData(this.apiUrl + policy + this.myEndpo ...

Ensuring contact form accuracy using jQuery and PHP

Can't seem to figure out why I am always getting false from the PHP file even though my contact form validation with jQuery and PHP is working fine. Let me explain with my code: Here is the HTML: <form method='post'> <label& ...

Ajax operates by fetching data from a database without requiring large files to be retrieved

Every time I try to retrieve a file larger than 0.5MB from the SQL database using AJAX, an error occurs. What am I doing wrong here? $(document).ready(function () { loadFileData(); }); function loadFileData() { $.ajax({ type: "GET", ...

When using Vuejs2, the list of autosize textareas connected to an expanding array of objects does not properly update their values

After binding https://github.com/jackmoore/autosize to textareas within a v-for loop, I've noticed an unexpected data persistence issue while expanding the array linked to that list: While inputs on the left side move downward as intended, new textar ...