Django Allauth and Google - django

I've tried to add google login to my web application using django-allauth.
I added to my google application the following callback_uri:
"http://localhost:8000/accounts/google/login/callback"
since i'm running tests on my development server (localhost) and i don't wanna use https.
Even though, i get a 'redirect_uri_mismatch' saying that my redirect URI doesn't match any registred redirect URI.
Does anyone have any ideea about what causes this?
Thanks for your time.
Later Edit:
Using 127.0.0.1 instead of localhost solved this problem.

Recently I ran into problems trying to get Google+ to work as well. I finally got it working. I made some updates to the documentation so it's a bit easier to use. See if using the updated allauth google docs you can get it to work.

Have you try doing the following:
1. Go to the Google Developers console -> Api $ auth -> credentials
2. You should see "Client ID for web application" click "Edit Settings"
3. Change your "Redirect URI" to "http://localhost:8000/accounts/google/login/callback"
Should work after that let me know if it doesn't.
Cheers,
Dan

Related

localtunnel not generating url string on Windows 10

I have followed this guide in setting up my localtunnel:
https://www.hongkiat.com/blog/accessible-local-web-server/
however, when I run the following command lt –port 80 nothing is showing. I started looking for this solution since Facebook seems to have stopped localhost access to FB.iu() method for sharing content on their site.
I have tried running as admin while disabling firewall and McAfees Antivirus Scan. I have used ngrok before now too but Facebook rejects it for no clear reason.
Below is an image of the steps taken:
Managed to get my way around this localhost tunneling issue using ngrok.
I noticed I'm expected to add additional domain names under App Domains in Facebook APP settings. So I added ngrok.io as an additional APP Domain and WHALAH! everything started working for the FB.ui() method.

Problem in hosting Django REST API on IIS

I was trying to host django REST API on IIS but it wasn't working properly. I worked with the same locally and it was working absolutely fine.
But when I hosted it on IIS then first of all its homepage with get method for all data from the database takes longer time to load and ended up with timeout error. And, when I tried to access other pages, the same problem occurred with them too. Only a page with post method opened but when I tried to submit data it raised an error.
I checked server configuration then I found that default error is timeout error. Now I am confused about why such things happened.
Can anyone please tell me if they faced similar issue or if they know some kind of compatibility issue or some prerequisite for hosting REST API using Django REST Framework? Or help me how can I find and fix the issue.
Are you using FastCGI? check the Authentication then try to disable windows authentication and enable anonymous authentication, try that if it will work.

Spree Paypal Integration Error

I am using Spree for my E-Commerce.
I have to integrate Paypal Payment Gateway. The tutorial that
I followed was [Paypal Integration with spree][1]
[1]: https://github.com/spree-contrib/better_spree_paypal_express. I had successfully created sandbox account. When I go for transaction all flows work fine but after I am redirected back to my own site, it throws an error "NoMethodError in Spree::PaypalController#confirm", I don't see this controller in my code and that tutorial link didn't do anything to create this one.
Please help me to resolve this. Thanks.
I am sorry. This is not a general issue.
Error was because of my code. Paypal did work fine and redirected fine.
I just had to fix my logic to handle this redirection of paypal using spree.

Authentication with apache2 php pages and tomcat REST calls

Hello smart people on stackoverflow,
I would be very happy if someone could point me to the right libraries/frameworks to do what I want.
We have the following web architecture set up.
1. We have a tomcat server that offers REST services.
2. We have an apache2 server that serves up php pages to users.
a. Some of these php pages make REST calls to tomcat for data.
b. Other php pages contain javascript that makes REST calls that are routed through apache2 via mod_proxy to tomcat. e.g. All request to http://myapache.com/PASSTOTOMCAT/rest/getSecureData would go to tomcat.
Now, I'm asked to add authentication to everything, both the user pages as well as the REST calls. It would obviously be ideal for the user to sign-in once for access to both.
What library can I use for this? I don't think I can use any php-based solution (ie. one that involves adding a ) because the pass-through url's won't have a chance to add this code and check for authentication. I think I need to use something built into apache2 itself.
One minor requirement is that I would like the user credentials stored in a mysql database as opposed to a file.
Am I over-thinking this?
Thanks in advance
Well it's been 5 days, so I guess I'll answer my own question...
I ended up using the new mod_auth_form for authentication because it lets you use a nice stylized webpage to log users in.
I also used mod_dbd to access user credentials in mysql.
I couldn't find a nice tutorial on this so I struggled through the installation and setup a bit, but if anyone cares, I created a set of instructions on my blog in case anyone else tries to do the same thing.
Installation
Setup

Secure browsing is not supported in my app

I have an old application that I'd like to get running again. I've updated the Facebook PHP-sdk to the latest version (I think) and everything is working for most users. Except those using secure browsing.
My app simply tell me that:
This application does not yet support secure browsing (HTTPS).
How do I fix this? I've looked though all the settings in the app-page and I can't figure it out.
You need to purchase and setup an SSL certificate and then plug your https url into your app's settings page. See their migration guide where it says this is now required.