Using Github login with a Django project - json

I'm working on making a site that allows login with Github and I'm using Django for this. I've gotten as far as redirecting the user to the github authorization page, and then redirecting the user to another part of my project after successful authorization. My question is then: How do i extract such things as the users username and other values? I imagine that a JSON object is sent to me, but how do I use it and where do I get it? I have never done anything like this before, so it might be obvious but if anyone could help me it would be appreciated. Bear in mind that I'm a newbie in Django.

Github login is just OAuth. There is full documentation on Github's dev site on how to do it manually, but you probably want to use one of the many Python libraries which make the process easier such as python-social-auth or django-allauth.

Check out:
https://developer.github.com/guides/basics-of-authentication/
But there is package with this functionality:
python-social-auth

Related

How can I get json information about a page that is on wordpress?

I am communicating with the guys over at google and they are helping us with our site 'central.bet.co.za'.
The guys over at google are saying that they need me to supply them with "CORS Compliant Predictive JSON Endpoint for the same."
I really dont know where to find this information as I have never used json before or wordpress for that matter
I have tried installing the json.api.user plugin but that doesnt seem to be solving any problems either
Do you mean the Wordpress core Rest API?
http://central.bet.co.za/wp-json/wp/v2/pages

Jira submission from a web page

I am trying to use the Jira REST API to submit issues.
This answer gives a POST method to submit issues
how to create an issue in jira via rest api?
Is there a way to integrate POST with html so you could submit things from a webpage?
If this is not possible, is there another way to create jira issues from a webpage?
I initially tried using the issue collector but it does not offer enough flexibility.
We are trying to have three required fields that combine to form the description, much like how the first example feedback from in the issue collector has a rating and then "what did you like" "what did you not like" boxes.
Sorry this question was initially rather unclear.
Thank you!
The JIRA API is primarily intended for use from scripts, not from web pages. There is no way to securely allow a web page to access the JIRA API directly.
If you want to allow users to create JIRA issues from a web page, use a JIRA issue collector.

google cloud print post

I'm trying to ultimately silently print using Google Cloud Print from a POST function that is called from code on a website.
I succeeded in testing cloud printing using my account and my printers using a form submit.
(you can see the code that worked for that here: https://stackoverflow.com/questions/23975931/programatically-change-file-name-in-google-chrome-print)
The form submit didn't ask me for any authorization that I could tell. It asked me for xsrf. I stumbled across the answer for this by testing here:
https://www.google.com/cloudprint/simulate.html
So my question is can some amazing person please take pity on me and post the entire code for POST to submit a print job to GCP INCLUDING the format for authorization and where I get that info?
I have read the manuals for cloud printing and the info on how to get an oauth (although I don't understand that part yet)
I am missing something that will be obvious to people who have done this before.
I have tried the php code at github - although I do not usually code in php.
I have programmed a lot of API's and there is something I am just missing here.
Thank you profusely in advance!
i developed this simple library in python. https://github.com/escube/GoogleCloudSpooler
You cna use as you wish.
I developed a server version as well, but the lib used is the one in this project.
Try to use it and tell me if you have problem with that, I'll be pleased to help.
You could try using an alternative service such as PrintNode which has an excellent API and is very simple to use.

How to use SecureSocial in a Single-Page-Application

I'm converting my Play 2 application to a SPA and I'm trying to figure out how to still use SecureSocial for authentication.
I'm removing all the HTML templates (except the ones used by SecureSocial to send emails) and modifying my controllers to only provide JSON responses.
Is it possible to prevent SecureSocial from rendering HTML and let my application exchange authentication data in JSON format? Is there any example or tutorial that explains this topic? I've been googling for a few days now and unable to find any useful or at least understandable information for a newbie like me.
Latest changes in master made SecureSocial more friendly with mobile and SPA apps. You can now use the LoginApi controller to authenticate a user using the UsernamePasswordProvider or any of the OAuth2 based providers.

Chrome Extension: log in in options page

i'm trying to make a chrome extension and I need the have an options page where the user is able to login. this way the extension knows who he is and can retrieve specific data from a server.
I'm not sure how to do this. Any one has a tutorial page or, better yet, a sample code?
thank you all!
A number of extensions use OAuth or OpenID for authentication. There is a tutorial for OAuth on code.google.com. You could also just use a username/password and make a XHR request to validate them. It really depends on the site and what authentication methods it offers.
You need an authentication engine... In other words you need to have a backend for your chrome extension which handles logging in and logging out. This is extremely easy to do. You can use a backend as a service if it's a small project (look at Parse or Firebase) or write your own backend using a framework like Ruby on Rails.
http://rubyonrails.org/; https://www.parse.com/; https://www.firebase.com/
Options pages are well documented on the official docs, including sample code.