yii2-authclient
yii2-authclient copied to clipboard
Get InvalidResponseException when refresh token expired
What steps will reproduce the problem?
Wait until both access_token and refresh_token expire. Then try to login.
What do you get instead?
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 |
It should refresh the token, yes.
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?
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.
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)?