matrix-appservice-twitter icon indicating copy to clipboard operation
matrix-appservice-twitter copied to clipboard

OAuth process indicator

Open lukebarnard1 opened this issue 8 years ago • 3 comments

At the moment, the provisioning API has no way of exposing OAuth process indication for a given user_id. When _getOAuthedTimeline endpoint is called, it won't find a timeline for someone who has not finished OAuth, falsely indicating that there is no OAuth state to remove. So it is currently impossible to reliably show a "Nuke OAuth State" button and hence impossible for a user of an interface to remove all trace of OAuth from the bridge.

Something like this would be suitable:

GET /_matrix/provision/getOAuthStatus?user_id=bla
{
    "status":"pending"
}

where

  • status === "pending" = OAuth process started. At this point, the unOAuth endpoint can be used to restart.
  • status === "success" = OAuth process finished. Again, the unOAuth endpoint can be used to remove the credentials from the bridge entirely.
  • status === "unauthenticated" = OAuth process not started, indicating that unOAuth will do nothing, and an OAuth process can be started.

lukebarnard1 avatar Dec 19 '16 16:12 lukebarnard1

Hmm. Yeah that looks okay to me. Out of interest, why unknown? If the OAuth process hasn't started, then you'd probably want "not set" or something. Unknown to me sounds more like a fail state if we loose track of what has happened, when we know the user hasn’t tried to auth.

Half-Shot avatar Dec 20 '16 15:12 Half-Shot

This is true. How about "unauthenticated"?

lukebarnard1 avatar Dec 20 '16 16:12 lukebarnard1

Yep, that's fine :+1:

Half-Shot avatar Dec 21 '16 20:12 Half-Shot