Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

firefox blocks incoming http conection to localhost:8080

more options

why does firefox blocks incoming http conection to localhost:8080 when I try to obtain a google oauth2 token using oauth2.py ?. The Google server returns the token via http to loaclhost:8080 and the port is blocked by firefox.

why does firefox blocks incoming http conection to localhost:8080 when I try to obtain a google oauth2 token using oauth2.py ?. The Google server returns the token via http to loaclhost:8080 and the port is blocked by firefox.

All Replies (10)

more options

Is Firefox presenting an error message or other indication about the port being blocked? (I'm hoping there is some unique text I could search in the source code or bug reporting system.)

If there's nothing in the page, please check the Web Console (Ctrl+Shift+K).

Helpful?

more options

I'm running the Linux version of FireFox.The oauth2.py script connects to Google and returns an authorization token back to 127.0.0.1:8080. I have to log on to the Gmail server and I think that the port (8080) can be set to any port. The script produces an http request for the auth token which is sent to 127.0.01:808 on the PC that made the request for the token. When Google tries to connect with the token FireFox reports:

"Unable to connect - FireFox can't establish a connection to server @ 127.0.0.1:8080"

The console shows "GEThttp://127.0.0.1:8008/?code=4/0AUJR-x6ThOB96eqMFvWOOnycRw2HPyZ8-C9krTj14ywmCwIh--vtHlkXkWKO_FIQ6bMG-Q&scope=https://mail.google.com/S_ERROR_CONNECTION_REFUSED"

Do you think changing the port would help?

Hope this helps

Helpful?

more options

Sorry for the duplication. I made a few changes.

I'm running the Linux version of FireFox.The oauth2.py script connects to Google and returns an authorization token back to 127.0.0.1:8080. I think that the port (8080) can be set to any port. The script produces an http request for the auth token which is returned ,by google, to 127.0.01:8080 on the PC that made the request for the token. When Google tries to connect with the token FireFox reports:

"Unable to connect - FireFox can't establish a connection to server @ 127.0.0.1:8080"

The console shows "GEThttp://127.0.0.1:8008/?code=4/0AUJR-x6ThOB96eqMFvWOOnycRw2HPyZ8-C9krTj14ywmCwIh--vtHlkXkWKO_FIQ6bMG-Q&scope=https://mail.google.com/S_ERROR_CONNECTION_REFUSED"

Do you think changing the port would help?

Hope this helps

Helpful?

more options

Judging from Google results links being purple, I've searched for this NS_ERROR_CONNECTION_REFUSED error before. I don't recall finding a crisp explanation of what causes it.

Can the application listening on port 8080 accept HTTPS connections?

Helpful?

more options

There is no application listening on 127.0.0.1:8080. As I understand the usage of oauth2.py script it is used to generate an oauth2 token that can be used to authenticate a third party log in to gmail account. The script generates an http request containing google credentials to a google server and returns the oauth2 code to the FireFox address bar of the pc that sent the http request. That return is "GEThttp://127.0.0.1:8008/?code=4/0AUJR-x6ThOB96eqMFvWOOnycRw2HPyZ8-C9krTj14ywmCwIh--vtHlkXkWKO_FIQ6bMG-Q&scope=https://mail.google.com/S_ERROR_CONNECTION_REFUSED".

I just want to connect to my google mail account and send mail from a Linux app I am writing. I tried all the smtp clients but, they all do not use oauth2. So they will not connect to google. Authentication fails. So this oauth2 token seems to be the only way to do it. Maybe the code is code=4/0AUJR-x6ThOB96eqMFvWOOnycRw2HPyZ8-C9krTj14ywmCwIh--vtHlkXkWKO_FIQ6bMG-Q&scope=https:// /mail.google.com/

That is all I know about this process.

Helpful?

more options

Okay, so presumably once your app is up and running, you can use a GET or POST request to pass a token to the app on the port it listens on. But for now, it makes sense that Firefox can't connect with a nonexistent endpoint.

Helpful?

more options

Searching the internet I found that this is an error on the Google side. The author states that this error may occur as Google continually changes it's authentication method. The code is indeed the string following the "code =". That "code" is pasted back in to the script to finally get the authorization code used to sign in to gmail account.

Then I can use an smtp routine with oauth2. The authcode generated by the script will allow my smtp coding to connect to gmail.

The goal is to use smtp to send mail within my application. All of the functions needed to construct the message are already written. This is the last thing I need to do. If this does not work, I'll try to shell out to FireFox and feed the list of recipients from a file. If I have to go that way how would I designate CC and BC recipients?

I'm going to try the script again today and I will post the results.

Helpful?

more options

Your logs imply that you're trying to connect to http://127.0.0.1:8008, not to 8080. 8080 is a popular port and it's unlikely that Firefox is blocking it.

Helpful?

more options

The log shows the response from the Google server. Google is indeed trying to connect to 127.0.0.1:8008. I set the response ID to 127.0.0.1:8080 in the original http request. Why Google responds to 127.0.0.1:8008 I do not know. The problem is on the Google side.

Good catch. I missed it. Used the FireFox console to return the error "GEThttp://127.0.0.1:8008/?code=4/0AUJR-x6ThOB96eqMFvWOOnycRw2HPyZ8-C9krTj14ywmCwIh--vtHlkXkWKO_FIQ6bMG-Q&scope=https://mail.google.com/S_ERROR_CONNECTION_REFUSED".

The author of the script anticpated this error in the docs and said use the code in the error message. He said it was due to Google continually changing thier rresponses.

From the error message I did receive the returned code (Code=...). That code is needed to complete the input to the script. The script ended without error and returned an authcode. Now it remains to test the oauth2 token with gmail and smtp. I'll post the results.

If I wind up shelling to FireFox how would I designate CC and BC recipients in a .csv file for FireFox to read recipients?

Thanks to everybody for your responses. They all have been very helpfull.

Helpful?

more options

Changed error in script to 127.0.0.1:8080. FireFox blocks port 8080 with error 401 Invalid client.

I'm running a script (mutt_oauth2.py) to add oauth2 to the Mutt email client. SMTP to Gmail now requires oauth2 to authenticate gmail account. both Mutt and mutt_oauth2.py can be found on internet.

Tried for four days to get this to work. No luck. Requires many codes from google and many steps then fails. I do not think more effort is worth it.

Will try Thunderbird. Any suggestions on a source of docs to program it would be appreciated.

Just looking for a Linux smtp client, that supports oauth2, that I can add to my vb like app to simply send mail. Used to be easy now with oauth2 it is not.

Probably will give up on mutt_oauth2.py.

Thanks for all your help!

Helpful?

Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.