How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask ATLPROG Your Own Question
ATLPROG
ATLPROG, Computer Software Engineer
Category: Programming
Satisfied Customers: 7677
Experience:  MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
44910485
Type Your Programming Question Here...
ATLPROG is online now
A new question is answered every 9 seconds

I need to add authentication to a Google Application Engine

Customer Question

I need to add authentication to a Google Application Engine python project. It can be Google User OAuth or just regular register/signin/signout.
Submitted: 2 years ago.
Category: Programming
Expert:  Michael Hannigan replied 2 years ago.
Hello. My name is***** can help you with your question. Do you have specific questions or do you need me to just take a look at it? Any detail you can provide about what you've done and what errors you are getting would be helpful.
Customer: replied 2 years ago.
I tried to use Google App Engine's Users API. I got a local log in to appear, and actually figured out how to route pages so when a user existed it displayed a certain page. But I don't have a log out capability working, and I'm not sure if my User log in is still working. What I need is a Google log in, and a way to log in and out on the index page. Then I need to be sure that users can only access pages after logging in. I don't know how to do that.
This is Python using webapp2, BTW. I'd like to keep it in that framework because if I need to do other stuff I don't really know too much else in Python yet.
Expert:  Michael Hannigan replied 2 years ago.
Is this on a server that I can access?
Customer: replied 2 years ago.
No, just localhost right now. I can send the files- its not massive.
Expert:  Michael Hannigan replied 2 years ago.
Sure... just zip them and attach.Are you using webapp2_extras.auth? Or trying to?
Customer: replied 2 years ago.
No- that would be fine. I just don't want to use say Django because I really don't get that yet and don't have time to learn yet another framework. I'll zip em up for ya.
Expert:  Michael Hannigan replied 2 years ago.
What IDE do you use?
Customer: replied 2 years ago.
I used sublime and the Google App Engine launcher for this one.
Expert:  Michael Hannigan replied 2 years ago.
ok... got google app engine going, and I see hello world... where is the authentication you have worked on?
Customer: replied 2 years ago.
Look in index.py
Expert:  Michael Hannigan replied 2 years ago.
Ok... where are those users supposed to come from?
Customer: replied 2 years ago.
If you got hello world from ReUse API folder, it was because Google App Engine generated a NEW app instead of opening the existing one. To use GAE Launcher on the existing app you need to use File>>AddExistingApplication, then point to the folder.
The "+" button creates a NEW application, complete with a Hello World app.
Expert:  Michael Hannigan replied 2 years ago.
Thought that's what I did. I will try again.
Customer: replied 2 years ago.
Users are added via a popup dialog box. If no one is logged in, that box lets you add an email address, the user. Here is the basic tutorial I used to get this far: https://cloud.google.com/appengine/docs/python/gettingstartedpython27/usingusers
Expert:  Michael Hannigan replied 2 years ago.
OK... I see it now.
Expert:  Michael Hannigan replied 2 years ago.
So, it looks like it is staying logged in once you log in.
Customer: replied 2 years ago.
Cool, well I'm glad I was able to get it that far along. I guess it needs a login/logout button on the index page- probably up on the nav bar. Then I need the pages restricted so they can't be accessed unless you are logged in.
I barely understand the routing in Python- I can sure make the buttons, but I'm not sure how to get them connected to the functions.
Expert:  Michael Hannigan replied 2 years ago.
I'll have to look this over. I'm not sure what it is using to log in... is it just the email address?
Customer: replied 2 years ago.
I really don't know. Its just a piece of that tutorial. That tutorial show some of the info on it. I think the pop up that shows for the GAE Launcher is a localized one, and that online it uses Google accounts.
Expert:  Michael Hannigan replied 2 years ago.
Do you have a GAE developer account?
Customer: replied 2 years ago.
Yes. Do you need access? I haven't deployed anything there yet. Just local GAE Launcher so far.