Hi
I've recently gone from writing seperate Android and iOS apps to using Ionic2, and I want to continue to use Endpoints as my backend. The problem is how to do the authentication. The authentication code for Android client side was done like this (know this isn't the best way, some encryption and safety is on the TODO-list):
backend.Builder pb = new backend.Builder(AndroidHttp.newCompatibleTransport(), new AndroidJsonFactory(), new HttpRequestInitializer() {
@Override
public void initialize(HttpRequest request) throws IOException {
HttpHeaders headers = request.getHeaders();
headers.set("authinfo", usernameTxt+"&"+passwdTxt);
request.setHeaders(headers);
}
});
I've done custom authentication on the server-side like
described on a StackOverflow answer.
In the javascript gapi I only see options for using Google accounts, but we want to use seperate username/password for our system. It doesn't seem to be any way to send custom headers and using custom authentication in the javascript api. Custom authentication is not documented which make searching for answers tedious. I've heard rumors that Snapchat uses google app engine, how do they get the custom username/password system? Is Firebase Authentication maybe the way to go? How would that be done in in the javascript code client side?
Any links, answers or other useful information is welcome :)