Getting ssl error when trying to authenticate user session in google app engine flexible (python flask app) - app-engine-flexible

Trying to loosely follow this tutorial to setup user authentication in an app that I am creating using GCP and python + flask:
https://cloud.google.com/python/getting-started/authenticate-users
However, when I try to authenticate the user session by logging in, I get the following error:
Error while obtaining user profile:
{'vary': 'Origin, X-Origin', 'content-type': 'application/json; charset=UTF-8', 'date': 'Mon, 05 Feb 2018 18:14:29 GMT', 'expires': 'Mon, 05 Feb 2018 18:14:29 GMT', 'cache-control': 'private, max-age=0', 'x-content-type-options': 'nosniff', 'x-frame-options': 'SAMEORIGIN', 'x-xss-protection': '1; mode=block', 'content-length': '186', 'server': 'GSE', 'status': '403', '-content-encoding': 'gzip'}: b'{"error":{"errors":[{"domain":"global","reason":"sslRequired","message":"SSL is required to perform this operation."}],"code":403,"message":"SSL is required to perform this operation."}}'
FWIW, this error pops up after I select the user account in the google authentication service. I am using python 3.6, running OSX, and the app is being served locally in a python virtual environment. Any help is greatly appreciated.

Related

Getting 403 Forbidden in Linkedin API V2 while querying for AdSupplyForecast

I am using the LinkedIn API V2 and I am trying to query the AdSupplyForecast endpoint from my company profile. I am using the following tutorial to build the request using Targeting Criteria V2:
https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads/advertising-targeting/ad-supply-forecasts
This is the request information:
GET https://api.linkedin.com/v2/adSupplyForecasts?q=criteriaV2&campaignType=TEXT_AD&account=urn%3Ali%3AsponsoredAccount%3A2560807&timeRange=(start:1541691210720,end:1544283210720)&targetingCriteria=(include:(and:List((or:(urn%3Ali%3AadTargetingFacet%3Agenders:List(urn%3Ali%3Agender%3AMALE,urn%3Ali%3Agender%3AFEMALE)))))) HTTP/1.1
Host: api.linkedin.com
Authorization: Bearer xxxxxxx
X-Restli-Protocol-Version: 2.0.0
This is the response information:
HTTP/1.1 403 Forbidden
X-Restli-Gateway-Error: true
Content-Type: application/json
Date: Thu, 08 Nov 2018 16:33:31 GMT
X-Li-Fabric: prod-lor1
Connection: keep-alive
X-Li-Pop: prod-efr5
X-LI-Proto: http/1.1
Set-Cookie: lidc="b=OB68:g=1068:u=602:i=1541694811:t=1541781211:s=AQGBKJna3VcsX87YCodNIDqiNNTr_AKi"
X-LI-Route-Key: "b=OB68:g=1068:u=602:i=1541694811:t=1541781211:s=AQGBKJna3VcsX87YCodNIDqiNNTr_AKi"
X-LI-UUID: FGtPJ0MzZRXgVVzfeCsAAA==
message:"Unpermitted fields present in PARAMETER: Data Processing Exception while processing fields [/account]"
When I am trying to query the AdBudgetPricing endpoint with the same account everything is working as expected.
seems like this request refuses to accept the account parameter in the url, could you remove this one ?
Edit:
examples for the targeting criteria containing an include and an exclude in all examples.
https://developer.linkedin.com/docs/ref/v2/ads/targeting-criteria-examples

SignalR 2.2 returns 404 Not Found on IIS 8.5

I've publish my Web-Api2 on a development server (Windows 2012 Server and IIS8.5).
I've added the Websockets Protocol role, and also went through the steps in this answer to make sure everything is set up on my side. The app is running under `Default Web Site'.
However, I'm still getting this error:
Microsoft.AspNet.SignalR.Client.HttpClientException: StatusCode: 404,
ReasonPhrase: 'Not Found', Version: 1.1, Content:
System.Net.Http.StreamContent, Headers:
{
Date: Fri, 15 Jul 2016 09:18:54 GMT
Server: Microsoft-IIS/8.5
X-Powered-By: ASP.NET
Content-Length: 1285
Content-Type: text/html
}
at Microsoft.AspNet.SignalR.Client.Http.DefaultHttpClient
<>c__DisplayClass2.<Get>b__1(HttpResponseMessage responseMessage)
at Microsoft.AspNet.SignalR.TaskAsyncHelper.<>c__DisplayClass19`2
<Then>b__17(Task`1 t)
at Microsoft.AspNet.SignalR.TaskAsyncHelper.TaskRunners`2
<>c__DisplayClass42.<RunTask>b__41(Task`1 t)
Do I need to add other server roles or configure IIS further?
The problem was on the client side of the application as shown from here Microsoft.AspNet.SignalR.Client.HttpClientException
The status code was 404 Not Found.
The problem was a wrong url passed to the hub connection after deploying from localhost to an actual IIS running in Windows 2012 server. Once the url was fixed, the client runs without problems.

Firebase deploy stucks / hangs without error message

The command Firebase deploy always stucks when I run it.
Here is the verbose info:
$ firebase deploy --token "SOMETOKEN" --debug
----------------------------------------------------------------------
Command: /usr/local/bin/node /usr/local/bin/firebase deploy --token SOMETOKEN --debug
CLI Version: 3.0.0
Platform: darwin
Node Version: v5.0.0
Time: Tue May 24 2016 14:25:31 GMT+0800 (CST)
----------------------------------------------------------------------
> command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase"]
> refreshing access token with scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase"]
>>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token refresh_token=SOMETOKEN, client_id=XXXXXX-XXXXXX.apps.googleusercontent.com, client_secret=XXXXXX, grant_type=refresh_token, scope=email openid https://www.googleapis.com/auth/cloudplatformprojects.readonly https://www.googleapis.com/auth/firebase
<<< HTTP RESPONSE 200 cache-control=no-cache, no-store, max-age=0, must-revalidate, pragma=no-cache, expires=Mon, 01 Jan 1990 00:00:00 GMT, date=Tue, 24 May 2016 06:25:33 GMT, vary=X-Origin, Origin,Accept-Encoding, content-type=application/json; charset=UTF-8, x-content-type-options=nosniff, x-frame-options=SAMEORIGIN, x-xss-protection=1; mode=block, server=GSE, alternate-protocol=443:quic, alt-svc=quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25", accept-ranges=none, connection=close
>>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/hackdaychat
<<< HTTP RESPONSE 200 server=nginx, date=Tue, 24 May 2016 06:25:34 GMT, content-type=application/json; charset=utf-8, content-length=109, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
>>> HTTP REQUEST GET https://admin.firebase.com/v1/database/hackdaychat/tokens
<<< HTTP RESPONSE 200 server=nginx, date=Tue, 24 May 2016 06:25:36 GMT, content-type=application/json; charset=utf-8, content-length=423, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
As you can see, I tried it with a token I have created before via firebase login:ci.
Without a token it is the same result.
I have also created the local Firebase project. There was no error during Firebase init.
Firebase --list works fine. FireBase login and Firebase logout works fine.
Some additional info:
$ node -v --> v5.0.0
$ npm -v --> 3.3.6
$ firebase -V --> 3.0.0
OS: OS X 10.11.4
Location: Shanghai, but using Proxy to Singapur.
Access to Firebase website works fine.
I have owner rights on the project I am using
I try to deploy some kind of empty project. Means: My public folder only contains index.html and 404.html.
Anyone got an idea what could go wrong?
I got similar problem
Try
firebase logout
then
firebase login
it's works on my case. Once i logged in it's seem firebase app required extra permissions
also
npm update -g firebase-tools
Same here
firebase login and logout work fine. Same with init.
Also tried with and without a token. Same result as described by Frank.
I am behind a corporate proxy.
node -v --> v4.4.2
firebase --version --> 3.0.1
npm -v --> 2.15.0

HTTP Client putAsync (Error 404 Method not Allowed)

I try to update an object with WEB API hosted on a remote server. I recover well the object but at the time of the change, the answer gives 404 method not Allowed. I tested to host my service in a machine of my colleague just nearby. It works well. Is what is needed to make a configuration or something else?
Thank you a lot.
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage responsse = client.PutAsJsonAsync("api/Collaborateurs/" + coll.matricule_collaborateur, coll).Result;
if (responsse.IsSuccessStatusCode) {
}
Error:
{StatusCode: 405, ReasonPhrase: 'Method Not Allowed', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Date: Thu, 12 Nov 2015 14:28:10 GMT
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Content-Length: 1343
Allow: GET
Allow: HEAD
Allow: OPTIONS
Allow: TRACE
Content-Type: text/html
}}
WebDAV is know to interfere with the verb PUT. Try uninstalling WebDAV if it is present on the server and you do not use it.
It may also be that you need to contact the remote server's administrator. PUT is sometimes blocked by network switches/routers. I.e. there well may be nothing you can do to fix this with code. Try using POST instead.

Email issues with Wordpress running on AWS Elastic Beanstalk

I'm running Wordpress 4.2 on AWS Elastic Beanstalk. I'm using a plugin that sends emails using the WP email API, which uses the server's (i.e. Elastic Beanstalk's) internal mail system.
The problem: emails that the app attempts to send to my university email (let's call it .uni.edu) fail, and they do work when sent to my standard gmail.
What's interesting is that I have no issues running the same application locally. The emails associated with the app send fine -- so obviously there's some issue with the way Elastic Beanstalk in particular is attempting to relay the messages to the .uni.edu server. Perhaps the .uni.edu server is picking it up as spam (when sent from Elastic Beanstalk, not when being sent through my local system) and bouncing it back, but I'm not experienced enough to diagnose this.
Does anyone have suggestions for either directly applying some kind of fix to this problem, or creating some sort of setup that is a workaround (e.g. setting something up on Elastic Beanstalk to send emails in a non-default way that is less likely to have issues working with the university email server)?
Here's a log from /var/mail:
From MAILER-DAEMON#ip-172-31-41-109.ec2.internal Fri Apr 24 21:39:52 2015
Return-Path: <MAILER-DAEMON#ip-172-31-41-109.ec2.internal>
Received: from localhost (localhost)
by ip-172-31-41-109.ec2.internal (8.14.4/8.14.4) id t3OLdq1k026047;
Fri, 24 Apr 2015 21:39:52 GMT
Date: Fri, 24 Apr 2015 21:39:52 GMT
From: Mail Delivery Subsystem <MAILER-DAEMON#ip-172-31-41-109.ec2.internal>
Message-Id: <201504242139.t3OLdq1k026047#ip-172-31-41-109.ec2.internal>
To: <webapp#ip-172-31-41-109.ec2.internal>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="t3OLdq1k026047.1429911592/ip-172-31-41-109.ec2.internal"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)
This is a MIME-encapsulated message
--t3OLdq1k026047.1429911592/ip-172-31-41-109.ec2.internal
The original message was received at Fri, 24 Apr 2015 21:39:42 GMT
from localhost [127.0.0.1]
----- The following addresses had permanent fatal errors -----
<univstudent#uni.edu>
(reason: 553 5.1.8 <webapp#ip-172-31-41-109.ec2.internal>... Domain of sender address webapp#ip-172-31-41-109.ec2.internal does not exist)
----- Transcript of session follows -----
... while talking to apathy.uni.edu.:
>>> MAIL From:<webapp#ip-172-31-41-109.ec2.internal> SIZE=1191
<<< 553 5.1.8 <webapp#ip-172-31-41-109.ec2.internal>... Domain of sender address webapp#ip-172-31-41-109.ec2.internal does not exist
501 5.6.0 Data format error
--t3OLdq1k026047.1429911592/ip-172-31-41-109.ec2.internal
Content-Type: message/delivery-status
Reporting-MTA: dns; ip-172-31-41-109.ec2.internal
Received-From-MTA: DNS; localhost
Arrival-Date: Fri, 24 Apr 2015 21:39:42 GMT
Final-Recipient: RFC822; univstudent#uni.edu
Action: failed
Status: 5.1.8
Diagnostic-Code: SMTP; 553 5.1.8 <webapp#ip-172-31-41-109.ec2.internal>... Domain of sender address webapp#ip-172-31-41-109.ec2.internal does not exist
Last-Attempt-Date: Fri, 24 Apr 2015 21:39:52 GMT
--t3OLdq1k026047.1429911592/ip-172-31-41-109.ec2.internal
Content-Type: message/rfc822
Return-Path: <webapp#ip-172-31-41-109.ec2.internal>
Received: from ip-172-31-41-109.ec2.internal (localhost [127.0.0.1])
by ip-172-31-41-109.ec2.internal (8.14.4/8.14.4) with ESMTP id t3OLdg1k026045
for <univstudent#uni.edu>; Fri, 24 Apr 2015 21:39:42 GMT
Received: (from webapp#localhost)
by ip-172-31-41-109.ec2.internal (8.14.4/8.14.4/Submit) id t3OLdgcq026044;
Fri, 24 Apr 2015 21:39:42 GMT
To: univstudent#uni.edu
Subject: [classifiedads] Password Reset
X-PHP-Originating-Script: 498:class-phpmailer.php
Date: Fri, 24 Apr 2015 21:39:42 +0000
From: WordPress <wordpress#classifiedads-test.elasticbeanstalk.com>
Message-ID: <bace4f13cdc099117cd4ac9c70e2531c#classifiedads-test.elasticbeanstalk.com>
X-Priority: 3
X-Mailer: PHPMailer 5.2.7 (https://github.com/PHPMailer/PHPMailer/)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Someone requested that the password be reset for the following account:
http://classifiedads-test.elasticbeanstalk.com/
Username: univstudentseas
If this was a mistake, just ignore this email and nothing will happen.
To reset your password, visit the following address:
<http://classifiedads-test.elasticbeanstalk.com/wp-login.php?action=rp&key=dzaUvJpcjAe243gNOysZ&login=univstudentseas>
--t3OLdq1k026047.1429911592/ip-179-35-41-109.ec2.internal--
This sounds very similar to another recent question about email:
http://stackoverflow.com/questions/29808262/unable-to-send-emails-from-linux/29810884#29810884
Does your ec2 instance have an associated external DNS? Is there a public IP associated with it. You'll need to apply some type of fix so that your outgoing email message has a domain other than webapp#ip-172-31-41-109.ec2.internal

Resources