Allow Firebase access on a closed network - android

I'm working on a mobile app (both android and ios) and recently we started a test on client qa lab.
Because the client needs a lot of security his network is closed.
So my app only runs if I'm connected to the network. And also we need to open the IP and ports to access to our backend from the app.
Everything was fine, but when the app wants to access to firebase to retrive all the remote configs, it can't. In my opinion that happens because the network is closed and can't access to outside urls. So client's IT departement is asking me which URL the must open.
Someone knows which is the Firebase IP/URL?
I can't found the info and android doesn't show me anything because is connecting (let say) using firebase library.
Thanks!

Related

How to manage Oauth 2.0 redirect on emulator

I'm working on a project which is a mobile application developed with Ionic. The project is split into two parts: a mobile front-end and a back-end. The back-end is performing all the calls to external services and applying business rules, while the front-end only calls my back-end.
One of the services I'm using is a IAM service using Oauth2 protocol. I've implemented the authorization code flow to integrate this service. Until now, I was always using the command ionic serve to run my front-end in a web browser, and everything is going well.
But now, for testing purposes, I need to run my front-end in an android emulator. In order for my front-end to contact my back-end, I'm using the IP 10.0.2.2 (which is the alias of the loopback of my machine where my back-end is running).
The problem is with the redirect of the authentication service. It is not something that I have control on, and it can take weeks or months for the service provider to update my client configuration. When I want to authenticate myself through the app running on emulator, it opens a InAppBrowser to perform the authentication. When I successfully authenticated myself against the service, the redirect URI is http://127.0.0.1:8080/xxxx, and this response is sent to that InAppBrowser.
My question is:
Is there a way to replace the base URL of that response (without changing the client configuration), so that I can send the call response to my back-end ?
NOTE: I've been trying to find a solution online, but I can't find anything on that topic. I suspect that in that matter, I probably lack some vocabulary in order to find what I'm looking for.
Is there a way to

Website shows data from Android App - Like WhatsApp Web

Does anyone know how WhatsApp Web have done this?
They show the messages/data from the Android phone connected to the Internet.
So it seems there is no database on the server site. They get all messages directly from the mobile app and sends also the changes directly.
How can this be done?
With Firebase or any other Library?
WhatsApp created an API which is used both for mobile and web end to communicate to each other and to the main database where all the messages and user information are stored.
The fact that your phone needs to be turned on and have internet connection still doesn't really show that the website pulls the information out of the phone itself.
What it is happening, more likely, is that the web extension communicates with the mobile phone linked to it to make sure that the account is still active on the mobile device and then proceeds to pull messages and information out of the database using the API.
I'm not excluding that the web extension retrieves some information form the device but it probably constantly keeps in sync with it to make sure the account is still active and there is no ambiguity between the account on the web extension and the account currently logged in to the mobile device.
Hope this clarifies a bit but there's no public documentation that I could find online so I'm going by what I believe is the most likely scenario.
:)
P.S. You can have a look here if you haven't already tried:
WhatApp website FAQ

Setting up a development server for mobile applications [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
How does one set up a development server for mobile apps?
In web development developers usually install XAMPP and then use localhost to communicate with the server and test in a safe environment. This is a free and fast working solution, since it requires very little or no upload time. What is an equivalent for mobile developers on the iOS or Android platform? Some kind of localhost for mobile app developers.
The goal is to develop a backend for a mobile app in a safe and quick environment. Their exact equivalent for web developers is using localhost.
Example: The user registers. Username and password along with an image are sent to the server and stored in the database. The next time the user logs in the server looks up in the database and serves the correct image to the user and logs him/her in.
I am not asking for how to program this or what code to use. I am asking for instructions to a set up developer test environment - a localhost for mobile apps, if such a thing exists.
As you mentioned, web developers, can quickly set your localhost by installing XAMPP or any equivalent web server, a database server like MySQL on localhost. They put their web services on a web server and call or use them from the front end (HTML page) on user actions like form submissions, button clicks, etc.
Mobile application development with Android is very much similar to the above approach. All web services lie at the back end, and you only call them from an Android client (mobile device) using the HttpClient or HttpUrlConnection class.
You can make only HTTP requests from a mobile application and get a response from the services which are called, parse the response and populate the UI elements.
You can set up your localhost with a database server, a web server as you mentioned correctly above. Now to make a request from your mobile device to localhost, keep your device and localhost machine on the same network (you can put both devices on the same Wi-Fi network) so that you can directly make requests to your localhost from your mobile application. You will get a response in the mobile app in whichever format you have provided and use it. This is very similar to that of web application, where you can imagine your UI lying in mobile device which was an HTML page in a web application.
Assuming that you have a web server / server application installed on your machine, then the requirement is that the device and server can communicate.
This is normally done using the HttpURLConnection class. You will need the IP address of your server in order to construct your URL, that is instead of accessing your server application using localhost/myapp you will need to add the url 192.168.0.255/my app (or whatever your actual IP address is).
There are a couple of issues to watch out for. Your development machine must accept incoming http requests (port 80 normally) through the firewall, and your router must allow the traffic between the machine and the device. Have a look at http://portforward.com/ if you are having trouble with this. If you are having trouble diagnosing the issues, then sometimes downloading a terminal app on the device can help.
Sometimes cheap routers or corporate policies make this difficult. In this case you can try setting up a portable hotspot or creating an ad-hoc network if your server machine also has a wireless network adapter.
If you're developing a mobile app then I would think you want to keep focussed on the mobile development part and therefore mock out the backend rather than write a working server with a database, logic, etc.
In very simple cases I would recommend using something such as Charles. This allows you to intercept requests in and out of your mobile app either from the simulator or device and validate everything is working as expected at a call by call level. If you want something more persistent then using a simple web framework in your language of choice with fixed responses would do the job well. For example, Sinatra for Ruby or Express.js for Node.js. And then rather than worrying about having a database to maintain and seed, just return fixed JSON responses for a particular call or a file from disk. This could then be committed with your mobile development code repositories and used as part of test suites.

what / which back-end an appstore or play market app is using?

How can one find out which or what an app is using as a back-end server?
Assume you are making an app and you are using Parse.com as your back-end server. You made an app and go published it to the appstore. Later, what are the odds for some one else to find out what did you use as a back-end server? Can she/he find out that you used Parse.com ?
What are the odds for an iOS app and Android playmarket app ?
Simply see what networks calls are being made by the app. No need to decompile or anything like that. Simply log network calls on your home network. Your Wifi router might do this or you could setup a proxy server that logs all requests.

Android/Appengine "anonymous" access

I'm planning to develop an Android application with an app-engine backend.
However I would like to refrain from using authentication (either with Google accounts or Open ID). Since the data will be sent only from my app and not any other client, and will be over SSL connection, I consider the data safe and trusted.
So my question is two-fold:
Is there any security issue I'm missing here ?
All the examples I found use some sort of authentication. Is it at all possible to use the android appengine infrastructure (RequestFactory, etc) without authenitcation ?
An app engine application is just a regular web application deployed on app engine. If you need to authenticate your users, do so. If you don't need to, then don't.
You're missing something, though: once a web app is deployed on app engine, it's accessible from anywhere on the web, and so anyone (and not just your app) could send requests to this application, whether you use SSL or not. SSL will just make the communication encrypted, and ensure the client that they're talking to your web app, and not to a rogue web app maskerading as yours.

Categories

Resources