python api verified number usinf firebase - python

I will create python api using Django
now I trying to verify phone number using firebase authentication end send SMS to user but I don't know how I will do

The phone number authentication in Firebase is only available from it's client-side SDKs, so the code that runs directly in your iOS, Android or Web app. It is not possible to trigger sending of the SMS message from the server.
So you can either find another service to send SMS messages, or to put the call to send the SMS message into the client-side code and then trigger that after it calls your Django API.

Related

Microsoft Graph API- Configure Python Quickstart for Web Application

I am building a web application that uses Microsoft's Graph API to authenticate and authorize the program to send emails on behalf of the client. The quickstart microsoft provides works locally but I need the authentication code that I'm provided locally to be given to the 3rd party user instead. I was thinking I could put the authentication code into a variable and then send it to the user via twilio API, but can't find a way to reference the authentication code.
The graph API outputs this message in my IDE but I can't find where this message and code originate.
"To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code ABX9TEZ45 to authenticate." (the code I provided is fictitious)

How to receive and parse email with Cloud Functions?

Google Cloud Functions allows you to easily activate a function upon a trigger (eg Firebase data change, HTTP request...).
I am looking for a way to execute a function when a user sends (or typically replies) to a email address. For instance, my dashboard sends an email, I would like to catch the reply, parse the content and upload it to Firebase as a comment in my Dashboard.
I understand that Google recommends to use Sendgrid. I however don't understand:
- How to setup the trigger upon a reply
- How to read the content and set the reading
I only found how to send emails here
One option if you use GSuite is to use the Gmail watch mechanism to listen to new emails in your inbox. The message can then be posted to a PubSub topic which can trigger a Cloud Function to parse the email and perform your necessary next steps.
Here is a good use case that explains this mechanism
https://cloud.google.com/blog/products/application-development/adding-custom-intelligence-to-gmail-with-serverless-on-gcp
Google Cloud Functions does not provide a permanent listener on an endpoint. There is also no event source for SMTP, which is the protocols involved with email delivery. So you can't simple respond to emails as they come in with Cloud Functions at the moment.
What you can do is direct the traffic to an existing SMTP server, and then use Cloud Functions to read from there at an interval.
An alternative is to use the Sendgrid Inbound Email API, which can call a webhook for every message it receives. And your webhook would then be a HTTP triggered Cloud Function.

Programatically Send Notification Email for an Office 365 Hosted Email Using REST or Python

I am starting work on a project that will involve sending an auto generated email to a user. I am (most likely) going to build the application using Python and Django and host it as an Azure web app. The outgoing email address (hello#example.com) is hosted on Office 365. After some digging it looks like the recommended method of sending emails is the 365 Outlook API. All the documentation shows how to authenticate using AAD for a user that is logging in. However, I need to access the same email address regardless of who is using the web app.
Is there a way to securely get access to an AAD token on the backed of the server without storing a password in plaintext? Preferably the it would be in Python or REST but if need be I can switch technologies.
You can create an app only following Client Credentials Grant flow, leveraging which you can authenticate and authorize for AAD in backend.
Here is a code sample on GitHub https://github.com/Azure-Samples/active-directory-python-graphapi-oauth2-0-access, which builds an app-only app leveraging AAD in Django.
Any further concern, please feel free to let me know.

How can I catch callback url in Evernote Python API through default interface?

I've looked lots of place but I can't find answer how can I implement it. My program is little sync app using Python Evernote API and *.txt file. I've used to auth for developer token and I need to auth for any user who uses to Evernote. I'm using interface as Tkinter and I need to g.e. "Log in with Evernote" button to going requests to Evernote and catching the callback url and including my program to
auth_token = "*****"
client = EvernoteClient(token=auth_token, sandbox=True)
The callback URL is for applications that utilize OAuth to obtain an access token to act on behalf of another user. OAuth is a separate authentication system from developer tokens which are for quickly accessing the API to test an application or to develop an application that only accesses your account; you cannot use developer tokens to access others accounts (its a violation of the API policy).
To access other's Evernote accounts, you need to use OAuth. First you must get a consumer key and consumer secret. The consumer key uniquely identifies your application and your consumer secret should never be shared but is used by your application to validate your use of your consumer key. You can get one here: https://dev.evernote.com/#apikey
For an example of how to use your consumer key and consumer secret to create an application that access the user's Evernote account see this small (~240 lines) example I created using the Python web framework Flask: https://github.com/matthewayne/evernote-giphy/blob/master/server.py
To learn how Evernote's OAuth work see Evernote authentication page: https://dev.evernote.com/doc/articles/authentication.php

Frontend and backend hybrid oauth2 flow?

My app needs to retrieve user's dropbox data in both frontend when user is present(js) and backend when user is away(python/django)
I understand after authorization I will receive a token code. Does that mean I should use this token code for both JS and Python when communicating with Dropbox? or should I use my python backend as a proxy when communicating with Dropbox?
I am worried by using a proxy it will add unnecessary delay to the user experience.

Categories

Resources