Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Google - continually use refresh token #117

Merged
merged 1 commit into from
Jul 3, 2015

Conversation

jehiah
Copy link
Member

@jehiah jehiah commented Jun 25, 2015

I was mistaken in my understanding in #116 because i thought that when you used a refresh token, the access token you got back was a long term token. It's not and must be continually refreshed when it expires using the refresh token.

@jehiah
Copy link
Member Author

jehiah commented Jun 28, 2015

@mbland ready for some feedback on this now. I ended up restructuring a bit more than i expected, but i'm much happier with a bunch of the code now, so that makes me 😃

I split apart the horrendously long OauthProxy.ServerHTTP() and it should be straight forward to follow the logic in OauthProxy.Proxy() now.

I'll start some production validation of this change set and update with status of that tomorrow or monday.

@mbland
Copy link
Contributor

mbland commented Jun 29, 2015

Looking now... Though it'll take a little while for me to scour through everything, offhand I really like the new cookie and session abstractions and how they're exposed in the provider interface. Much better than my proposed hack to maintain the status quo.

if ok {
email, user, access_token, err = parseCookieValue(value, p.AesCipher)
}
func (p *OauthProxy) LoadCookiedSession(req *http.Request) (*providers.SessionState, time.Duration, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Any reason not to use named return variables as done elsewhere?

@mbland
Copy link
Contributor

mbland commented Jun 29, 2015

OK, that seems enough for one round. :-)

* New SessionState to consolidate email, access token and refresh token
* split ServeHttp into individual methods
* log on session renewal
* log on access token refresh
* refactor cookie encription/decription and session state serialization
jehiah added a commit that referenced this pull request Jul 3, 2015
Google - continually use refresh token
@jehiah jehiah merged commit 01c9d04 into bitly:master Jul 3, 2015
@jehiah jehiah deleted the always_refresh_117 branch September 23, 2015 13:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

2 participants