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

Get InvalidResponseException when refresh token expired #229

Open
hiqsol opened this issue Jun 15, 2018 · 4 comments
Open

Get InvalidResponseException when refresh token expired #229

hiqsol opened this issue Jun 15, 2018 · 4 comments
Labels
status:ready for adoption Feel free to implement this issue. type:bug Bug

Comments

@hiqsol
Copy link
Member

hiqsol commented Jun 15, 2018

What steps will reproduce the problem?

Wait until both access_token and refresh_token expire.
Then try to login.

What do you get instead?

refresh

What's expected?

The token expiration is quite normal situation.
Should not it finish somehow normally without exception?

What is recommended way to process this situation?
I want to redirect user to login when this happens (refresh token expires).

Additional info

Q A
Yii version dev-master a741165
Yii Auth Client version 2.1.5
Yii HTTP Client version dev-master 33118fc
PHP version 7.1
Operating system some Debian in Docker in Ubuntu 16.04
@samdark
Copy link
Member

samdark commented Jun 17, 2018

It should refresh the token, yes.

@samdark samdark added type:bug Bug status:ready for adoption Feel free to implement this issue. labels Jun 17, 2018
@hiqsol
Copy link
Member Author

hiqsol commented Jun 18, 2018

It should refresh the token, yes.

No, it can't refresh anything cause refresh token is expired.
AFAIU the library can't proceed with login in this situation.
But I think it should not just throw connection level exception. Or it is ok?

If you use this extension how do you process this situation?

@samdark
Copy link
Member

samdark commented Jun 18, 2018

Right. If the token is expired and we cannot refresh it, it's OK to throw an exception. Maybe domain-specific one such as RefreshTokenExpiredException. The exception should be caught at application level and, I guess, redirect user to login screen.

@cleippi
Copy link

cleippi commented Jun 18, 2018

I'm also interested in knowing how to properly process this situation. Where do we catch the exception? How do we force someone to re-authenticate via oauth (facebook)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue. type:bug Bug
Projects
None yet
Development

No branches or pull requests

3 participants