Comments (5)
This is tricky to figure out with the given information. We use it on our live server with no issues, so I know 'it works' at least in our environment.
Do you get an HTTPAuthorizationFailed for every request or just for some of them?
Are you using a single refresh token for the app, or does each user have their own?
Do you use any caching?
from google_calendar.
The flow is basically this
App is configured with client id and secret, as well as calendar id. Once app starts up, using standard oauth flow, user (calendar owner) gets a refresh token using omniauth. This token is stored for future use.
Calendar api is initialized with the same client id and secret used for oauth.
This process will work locally, however when pushed to a server (heroku app) it successfully gets an oauth token, but fails to connect via the calendar api. The only difference I can tell between the two environments is possible issues around origin and callback urls.
The token has greater scopes than just calendar, but the app is not configured to use strict scopes.
from google_calendar.
Make sure your origin and callback urls match those that you are using on the live server. You can setup multiple entries for both fields in the google developers console.
if that doesn't work add some logging to the Connection::send method and we'll go from there.
from google_calendar.
Thanks for the help, I added some debug code but it ended up not being a huge help.
My issue seemed to be one or all of several issues.
-
I was not explicitly requesting access_type offline for the token. Offline is the omniauth default but it does not seem to necessarily request it on it's own.
-
Somehow I had a mismatch between my client ids and secrets (OR when I changed something it regenerated a secret)
-
I was using the client ID not the client email.
Note: I never received an Oauth failure, oauth ALWAYS worked, but rather calendar login failed. After changing these things randomly, things began to work. Perhaps oauth sessions get cached google-side preventing new changes from taking place, and from auth issues from being seen further down the line. Quite bizzare.
So it seems to be working now, still no idea why it worked locally. It must have been a token cached by google that caused the issue.
thanks for the help, and watch out for these issues!
from google_calendar.
Thanks for following up. Hopefully this will save someone else some time.
from google_calendar.
Related Issues (20)
- Attachments HOT 1
- Signet::AuthorizationError -- invalid_user HOT 1
- Dependabot can't resolve your Ruby dependency files HOT 1
- All retrieved events are marked as transparent
- Attributes not writable HOT 2
- client_secret HOT 1
- Events do not return free/busy status
- Events do not return updated time HOT 1
- Creating new calendars HOT 6
- Сonfirmation of the event of attendees
- Cannot set a specific date for an event HOT 3
- SSL error on a Mac? HOT 2
- Recurrence rule error HOT 7
- Newlines in description HOT 4
- Is Version 0.5 gem out of sync with github? HOT 5
- calendars.clear always returns "Cannot clear primary calendar." HOT 1
- deleting a particular event
- Zone conversion bug HOT 3
- Missing rest of CRUD operations for calendar HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google_calendar.