Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to whitelist multiple domains phonegap (cordova)

Tags:

cordova

How can I list multiple domains? I know how to whitelist one with all it's subdomains, but what if I need more than one? Add more access elements?

like image 410
Costa Michailidis Avatar asked Aug 27 '14 19:08

Costa Michailidis


People also ask

What is Cordova plugin whitelist?

The plugin whitelist can be defined as the security model that is responsible for controlling an access to the external domains. The Cordova mainly offers a configurable security policy that defines which of the external sites can be accessed.

What is whitelisting of domains?

A whitelist (allowlist) is a cybersecurity strategy that approves a list of email addresses, IP addresses, domain names or applications, while denying all others.

How Cordova works internally?

Cordova acts as a container for the app that you write using web technologies. When the app is compiled, your code actually stays intact. The compiler just takes your code and makes it available to the web view for rendering. If you've ever opened an HTML file in a browser, that's basically the same thing.


1 Answers

The Cordova docs refer to the Widget Access specification, which states:

Zero or more access elements can be placed in the configuration document. When multiple access elements are used by an author, the set of network connections that are allowed is the union of all the access requests that were granted by the user agent.

In other words, just include multiple elements:

<access origin="http://example.net"/>
<access origin="http://another_example.net"/>
like image 142
CodingWithSpike Avatar answered Sep 23 '22 19:09

CodingWithSpike