Google App engine user authentication (python 3.7) - python

I am looking for a simple method to authenticate (using Goggle account) users into an python 3.7 app running on GAE.
In the past (using python 2.7) I have used
https://cloud.google.com/appengine/docs/standard/python/users/loginurls
and the logic was something like:
def my_end_point():
if user is not authenticated:
redirect_to_google_login()
else:
user_email = get_user_email_from_auth_service()
do_the_endpoint_logic(user_email)
I would like to keep this simple logic under GAE python 3.7
I have found this and I was wondering if someone wrapped this logic with decorator..
any directions?

The the App Engine standard environment Python 3.7 runtime does not support the Users API service. Your options are:
Firebase Authentication
Google Sign-In
OAuth 2.0 and OpenID Connect
via https://pypi.org/project/Flask-OAuthlib
via https://authlib.org

Nowadays (Januari 2022), the Python 3.x runtime does support the Users API by means of the App Engine bundled services. There is a very detailed and straightforward documentation page on how to enable this in App Engine.
Several other options for user authentication are described here.

Related

Creating a desktop Python app with Firebase, how do I include the private key?

I'm trying to build a desktop application that is built with python and pyqt5. I want to send it to users with their own login details, but I am not totally sure what to do with the private key. Up until now, I've had to do
export GOOGLE_APPLICATION_CREDENTIALS=[path to private key json]
or for windows
set GOOGLE_APPLICATION_CREDENTIALS=[path to private key json]
Obviously I don't want to give out the private key. Is it ok to store it in the program, or is there a special safe way to do that? I'm using pyinstaller to package everything.
The only SDK Firebase provides for use wit Python is a so-called Admin SDK. As the documentation on [setting up the Admin SDK] says:
The Admin SDK lets you interact with Firebase from privileged environments
So this SDK is not suitable for developing applications for your regular users, as the credentials it requires grant the user full administrative access to your Firebase project.
There is no official Firebase SDK for developing Python applications for regular clients, so your options are limited to:
Using the REST APIs for the various Firebase services, and writing your own client-side Python code against that.
Using a third-party API, such as Pyrebase that supports both client-side and administrative access.

How to get credentials in Google AppEngine Python37

I started new app in AppEngine Python3.7 stadard.
I am trying to get credentials using the following snippet, but its failing.
Anybody able to get credentials in GAE standard Python37 ?
Input:
from google.auth import app_engine
credentials = app_engine.Credentials()
Output:
The App Engine APIs are not available
When using App Engine Standard with python 3.7, none of the google.xxx libraries are available. You have to build your own, or use standard Python libraries. This goes for: auth, users, images, search, mail, taskqueue, memcache, urlfetch, deferred, etc., and even the ndb datastore interface.
For datastore, you use google-cloud-datastore or some 3rd party.
For others, you use a standard Python library, e.g.: google.auth => rauth, google.appengine.api.memcache => python-memcached
Read more here: https://cloud.google.com/appengine/docs/standard/python3/python-differences
That page recommends Google Identity Platform or Firebase Authentication to do authorization.

Using openshift Rest Api in Django framework Python application

i want to strarted to build an application using framework Django in python to consume Openshift rest api that the user will be able to authentication and use their resources.
the objectif of this project is to provide a web-based platform to enable Openshift users to create or interact with their online resources using Openshift web api Rest 3.0 .
Specifications of project : The required service should enable existing projects and new projects management for any user having an Openshift online account. Management includes: -Authentication and Authorization -Teams , members and subscription plan management -SSH keys management -Gear, cartridge and application management -Deployment All these capabilities must be implemented using the Openshift API and provided using a Django based web interface.
i try to read the officiel documentation through URL:https://access.redhat.com/documentation/en-US/OpenShift_Online/2.0/html/REST_API_Guide/index.html
but i can't find a way to start building the application and consuming this rest api. have any one an idea to start
If you are writing a new application, I suggest using v3. The web console already has most of this functionality. The REST API reference should help you get started.

Can I use Firebase Admin SDK in AppEngine (Python)?

I need to deploy a project that must use Python in AppEngine, and I must use Firebase.
The point is that the use of secret is deprecated, and now Firebase uses "Firebase Admin SDK", that only has support on NodeJS or Java.
There is a possibility to use with the standard appEngine with Python?
There is now a Firebase Admin SDK for Python as of one week ago. It only has support for creating custom tokens and verifying ID tokens as of now. However, it is tested on AppEngine. See documentation at https://firebase.google.com/docs/admin/setup to see how to get started.

Python - Intranet Web Service

About to embark on a Java project using Spring Security to create a Restful Web Service (JSON) that will use Kerberos authentication to authenticate users in Active Directory.
I'm not locked into using Java and am considering the use of Python to gain new skills and look at potential alternative platforms.
So far I have looked at Twisted and Web2Py but they don't seem to have support for Kerberos nor could I find information around implementing Kerberos support.
Does anyone know of frameworks supporting the above deployment or pointers to get me started?
Python Eve is a restful api written in Python that uses mongo as its backend.
It provides a simple class that you can use to implement your own authentication which would allow you to use the python kerberos module
I use this setup but with ldap instead of kerb.
The underlying web framwork behind eve is Flask.

Categories