Endpoints custom authentication javascript?

40 views
Skip to first unread message

Marie Ekeberg

unread,
Jul 10, 2017, 5:50:29 AM7/10/17
to Google App Engine
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 :) 


 

George (Cloud Platform Support)

unread,
Jul 11, 2017, 1:24:04 PM7/11/17
to Google App Engine
Hello Marie, 

You can create a custom authenticator for Endpoints, as detailed on the "Interface Authenticator" documentation page. General authentication-related information for Endpoints is presented on the "Authenticating Users" page

Let us know if this information addresses your concern. You are most welcome to come back with more detailed questions. 

Dan Ciruli

unread,
Jul 11, 2017, 2:27:07 PM7/11/17
to google-a...@googlegroups.com
Marie -

You could also look at using Cloud Endpoints along with Firebase. Firebase does allow for username/password auth and features mobile client libraries for generating the JWTs. 

or



--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/89f3dc25-ce51-4d11-8792-36fec2a308f9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages