Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redirecting to 127.0.0.1 not working #5

Closed
la32094uf opened this issue Nov 19, 2015 · 3 comments · Fixed by #31
Closed

redirecting to 127.0.0.1 not working #5

la32094uf opened this issue Nov 19, 2015 · 3 comments · Fixed by #31

Comments

@la32094uf
Copy link

After updating to the latests 0.6, granting acces,

schermafbeelding 2015-11-19 om 20 48 05

i still get a redirect to a non-working 127.0.0.1:1337 page

schermafbeelding 2015-11-19 om 20 48 46

@azai91
Copy link
Owner

azai91 commented Nov 20, 2015

Can you open the workflow (right click on the workflow and click open in finder) and then paste in the text inside the nohup.out. If possible (not necessary), can you run the following line in your command line (in the root of the source files),

python server.py

and let me know what is printed the console?

Thanks!

@ralphcallaway
Copy link

ralphcallaway commented Apr 29, 2016

running into the same issue, mac os x 10.10.5, alfred v2.8.4 (437)

checked nohup.out, and it's empty

ran python server.py and then refreshed the browser windows with the google authorization code, got this in the terminal output

14:04:49 workflow.py:2471 DEBUG    Password exists : com.drive.azai91:drive_access_token
14:04:49 workflow.py:2518 DEBUG    Got password : com.drive.azai91:drive_access_token
14:04:49 workflow.py:2540 DEBUG    Deleted password : com.drive.azai91:drive_access_token
14:04:49 workflow.py:2481 DEBUG    save_password : com.drive.azai91:drive_access_token
14:04:49 workflow.py:2471 DEBUG    Password exists : com.drive.azai91:drive_refresh_token
14:04:49 workflow.py:2518 DEBUG    Got password : com.drive.azai91:drive_refresh_token
14:04:49 workflow.py:2540 DEBUG    Deleted password : com.drive.azai91:drive_refresh_token
14:04:49 workflow.py:2481 DEBUG    save_password : com.drive.azai91:drive_refresh_token
14:04:50 workflow.py:2518 DEBUG    Got password : com.drive.azai91:drive_access_token

tried running login from alfred a couple times, which didn't generate any output, and timed out again

at some point things started working, yay! i was doing a bunch of different things, but seems like doing the following should work for people

  • open alfred
  • "d >" -> login
  • complete google oauth flow
  • wait for browser to time out at 127.0.0.1
  • open terminal and run python server.py
  • refresh browser window
  • be patient
  • try it out

@pkuczynski
Copy link

Might be connected to #16

sorbits added a commit to sorbits/alfred-drive-workflow that referenced this issue Aug 24, 2017
I realize that it is not popular to change the implementation to another language, but I felt a major refactoring was called for to continue adding desired features, and as I work a lot faster in ruby, I decided to do it in ruby.

Some of the improvements that this rewrite brings:

- When we have cached data, we immediately return a response to Alfred based on the cache. If the cace is older than 10 minutes, we refresh the cache _in a background process_ and instruct Alfred to reload the list again after 0.8 seconds.
- Removed `d > Clear Cache` and `d > Set Cache [seconds]` because of the improved caching behavior.
- The create actions accept an optional document name and are no longer under `d >`, for example `d ns Budget` should now create a spreadsheet named “Budget”. Closes azai91#11.
- Removed `d > Login` as we automatically open the Google Sign In page when refresh token is missing/invalid.
- Changed `d > Logout` to `d Sign out of Google Drive` and made it perform an account sign out (instead of just deleting the access tokens).
- Refresh access token when expiration time is less than 10 seconds into the future. This avoids an extra (failing) server request/response, which is mainly for the document creation actions, as Google’s servers are on the slow side.
- The OAuth2 HTTP callback server is running in our main process, this means that we can perform actions that require authentication _after_ we receive the callback from Google, for example `d new document` without a valid token will now first ask the user to sign in and _then_ create the new document. It also improves robustness slightly because error handling is in the same process.
- Cache is refreshed (in the background) after creating a new document.
- Add verbose (timestamped) logging which should make troubleshooting easier.
- The OAuth2 HTTP callback server will run until we see the expected `GET /` request (so not fooled by a `favicon.ico` request or similar) and it uses a URL parser to obtain the `code` query parameter from the callback URL.

The above should fix azai91#5, azai91#16, azai91#23, and azai91#25.

You can also close azai91#28 (but I already did that in 6006836).
@sorbits sorbits mentioned this issue Aug 24, 2017
sorbits added a commit that referenced this issue Aug 28, 2017
I realize that it is not popular to change the implementation to another language, but I felt a major refactoring was called for to continue adding desired features, and as I work a lot faster in ruby, I decided to do it in ruby.

Some of the improvements that this rewrite brings:

- When we have cached data, we immediately return a response to Alfred based on the cache. If the cace is older than 10 minutes, we refresh the cache _in a background process_ and instruct Alfred to reload the list again after 0.8 seconds.
- Removed `d > Clear Cache` and `d > Set Cache [seconds]` because of the improved caching behavior.
- The create actions accept an optional document name and are no longer under `d >`, for example `d ns Budget` should now create a spreadsheet named “Budget”. Closes #11.
- Removed `d > Login` as we automatically open the Google Sign In page when refresh token is missing/invalid.
- Changed `d > Logout` to `d Sign out of Google Drive` and made it perform an account sign out (instead of just deleting the access tokens).
- Refresh access token when expiration time is less than 10 seconds into the future. This avoids an extra (failing) server request/response, which is mainly for the document creation actions, as Google’s servers are on the slow side.
- The OAuth2 HTTP callback server is running in our main process, this means that we can perform actions that require authentication _after_ we receive the callback from Google, for example `d new document` without a valid token will now first ask the user to sign in and _then_ create the new document. It also improves robustness slightly because error handling is in the same process.
- Cache is refreshed (in the background) after creating a new document.
- Add verbose (timestamped) logging which should make troubleshooting easier.
- The OAuth2 HTTP callback server will run until we see the expected `GET /` request (so not fooled by a `favicon.ico` request or similar) and it uses a URL parser to obtain the `code` query parameter from the callback URL.

The above should fix #5, #16, #23, and #25.

You can also close #28 (but I already did that in 6006836).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants