social login with google in django 400 error - gmail-api

socail login with google in django getting Error 400: invalid_request
website name:boan.in
Authorization Error
Error 400: invalid_request
device_id and device_name are required for private IP: http://172.31.8.75:8080/accounts/google/login/callback/
Learn more
Pleasae help me to resolve

Google does not accept a local (private) IP address when doing Oauth or API calls. Instead, you can add an entry in your Windows hosts file for the local IP: \Windows\System32\drivers\etc
172.31.8.75 fakedomain.com
Then change your call back URI from http://172.31.8.75:8080/accounts/google/login/callback/
to http://fakedomain.com:8080/accounts/google/login/callback/
Finally browse the service with http://fakedomain.com:8080
I had the same problem and it is resolved now.

Related

AWS API Gateway: 403 MissingAuthenticationTokenException for /static/js/bundle.js even though Authorization is set as None

I have set up this flow:
external world --> AWS API Gateway ---> VPC Link ---> Network Load Balancer ---> my single EC2 instance
The API Gateway is working because when I input the custom domain in my browser, it successfully visits the frontend service running on my EC2 instance.
However, for /static/js/bundle.js, I'm getting a 403 MissingAuthenticationTokenException error:
But the request to the main domain is ok:
Also, all other resources failed:
/static/js/vendors~main.chunk.js
static/js/main.chunk.js
/favicon.ico
/manifest.json
My frontend is written in React JS.
Note that it says: x-amzn-errortype: MissingAuthenticationTokenException.
But I have set the Authorization to be None:
What is going on?

GCP Extensible Service Proxy encounters error when forwarding request

I have a the following setup:
1. Application (Java microservice) deployed on app engine.
2. Custom domain mapped to hit this service:.
myfavmicroservice.project-amazing.dev.corporation.com
3. This endpoint is secured to require authentication by enabling IAP.
4. Configured ESP to intercept, authenticate and fulfill request to all
backend microservices (like above) with a common gateway endpoint.
5. Microservice is deployed using app.yaml.
6. ESP endpoint is configured using api.yaml (OpenAPI API Surface document)
This is the tutorial I am following:
https://cloud.google.com/endpoints/docs/openapi/get-started-app-engine-standard
app.yaml to deploy the microservice:
runtime: java11
entrypoint: java -jar tar/worker.jar
instance_class: F2
service: myfavmicroservice
handlers:
- url: /.*
script: this field is required, but ignored
The ESP api.yaml for describing microservice api surface is like this
swagger: "2.0"
info:
title: "My fav micro Service"
description: "Serve my favorite microservice content"
version: "1.0.0"
# This field will be replaced by the deploy_api.sh script.
host: microservice-system-gateway-5c4s43dedq-ue.a.run.app
schemes:
- https
produces:
- application/json
paths:
/myfavmicroservice:
get:
summary: Greet the user
operationId: hello
description: "Get helloworld mainpage"
x-google-backend:
address: https://myfavmicroservice.project amazing.dev.corporation.com
jwt_audience: .....
responses:
'200':
description: "Success."
schema:
type: string
'400':
description: "The IATA code is invalid or missing."
schema:
type: string
But the problem is that whenever I make request to endpoint like this:
GET
https://microservice-system-gateway-5c4s43dedq-ue.a.run.app/myfavmicroservice
I always get gateway 500 error. Upon inspection of ESP logs I am finding primarily
1. SSL Handshake Error with Error no 40
2. upstream server temporarily disabled while SSL handshaking to upstream
3. request: "GET /metadatasvc-hello HTTP/1.1", upstream: "https://[3461:f4f0:5678:a13::63]:443/myfavmicroservice
So the ESP is intercepting my request correctly, perhaps forwarding the request in correct format as well as evidenced from #3. But I am getting SSL error.
Why am I getting this error?
Ok figured out the issue. For the benefit of stackoverflow community I am posting the solution here.
I figured that if you use custom domains that you map to app engine like this in the OpenAPI Configuration (That you deploy to ESP), SSL handshake fails:
x-google-backend:
address: https://my-microservice.my-custom-domain.company.com
However if you use the default URL that is assigned by APP Engine upon startup of the microservice like this, everything is fine:
x-google-backend:
address: https://my-microservice.appspot.com
So I am trying to figure out how to use custom domain mappings in ESP OpenAPI configuration. For now though, if I do that the SSL proxying is not working inside ESP.

javax.mail.MessagingException: 501 5.5.1 HELO/EHLO requires domain address

My web app (java/spring) application in localhost sends email successfully but when i
deploy it on host i got following error:
javax.mail.MessagingException: 501 5.5.1 HELO/EHLO requires domain address
I use java mail library.
web server: tomcat 7
thanks.
after a lot of googling i found the workaround below:
http://www.coderanch.com/t/271097/java/java/JavaMail-Exception-HELO-requires-domain
we should add the following props when creating the session to bypass "send hello first" error:
props.put("mail.smtp.auth", "true")
props.put("mail.smtp.transport.protocol", "smtp");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.localhost", "127.0.0.1");
but it is a workaround and the root cause is not found.

Google App Engine URI Error: /_ah/xrds

In my GAE admin dashboard, everyday I have URI Error below:
/_ah/xrds 50 100%
The application was written in Java. Authentication type is (Experimental) Federated Login.
I checked the log:
"GET /_ah/xrds HTTP/1.0" 404 2107 - - "www.example.com" ms=27 cpu_ms=27
app_engine_release=1.8.0 instance=....
How to prevent this error? What is the cause of the URL error?
Thanks

appcfg appengine 502 Proxy error in localhost

I am trying to upload some data to my local datastore in appengine.
The command I am using is the next one:
appcfg.py upload_data --config_file="C:\config.yml" --filename="C:\mycsv.csv" --url=http://localhost:8888/remote_api --kind=MyEntity
The problem is that I'm working behind my company proxy and I am getting the next ERROR even trying to connect to the localhost server:
Error Code: 502 Proxy Error. The ISA Server denied the specified Uniform Resource Locator (URL). (12202)
It seems the authentication is ok, but somehow the proxy tries to filter my connection to my own computer.
Some ideas about how can I solve this?
Thanks.
Remove/disable proxy settings of your network then try the above command.
I was facing the similar issue and this issue resolved when i disable my proxy settings.

Resources