ringcentral/ringcentral-js

Logout failed in implicit flow

embbnux opened this issue · 8 comments

In implicit flow when call logout, it will throw 401 error.
It is because our api doesn't support to revoke implicit flow token. The token will expired in a hour.

So when user calls logout in implicit flow, we just need to clear token cache.

Hi @kirill-konshin In client side, we can only get access_token in implicit flow. To refresh token in implicit flow, we need to use iframe to visit auth page, and get new token from redirect uri.

I mean if there's no refresh_token in auth data it means that implicit flow was used. We can use this to bypass the request.

Yes, we can do that

Can you send a PR?

Sure

Found that revoke api works for implicit token if client provides app client secret.
But in implicit flow, actually we don't want to add app secret in client side.
So revoke api return 401 when client doesn't provide app client secret.
So using app secret to bypass the request will be better.