Hi All
is it possible (in a test app) to login as user 1, view files etc, then log out and log in as user 2, view their files etc?
My app is using an OAuth2 flow in .net, its a windows forms app.
during the authentication routine, it opens a browser window and presents the login page. the access token is then kept to validate operations.
when logging out, i remove the access token (set to string.empty), in addition - ive also sent a TokenRevokeAsync request. after awaiting that event it loads up the login browser and immediately restores the previous access token.
Im using the Developer API for .net (official)
the method on the login form(browser) that is called, is:
Public Sub Start(ByVal appKey As String)
Me.oauth2State = Guid.NewGuid().ToString("N")
Dim authorizeUri = DropboxOAuth2Helper.GetAuthorizeUri(OAuthResponseType.Token, appKey, New Uri(RedirectUri), oauth2State, False, False)
Me.Browser.Navigate(authorizeUri)
End Sub
then:
Private Sub BrowserNavigating(ByVal sender As Object, ByVal e As NavigatingCancelEventArgs)
If (Not e.Uri.ToString().StartsWith(RedirectUri, StringComparison.OrdinalIgnoreCase)) Then
' we need to ignore all navigation that isn't to the redirect uri.
Return
End If
Try
Dim Result As OAuth2Response = DropboxOAuth2Helper.ParseTokenFragment(e.Uri)
If (Result.State <> Me.oauth2State) Then
Return
End If
Me.AccessToken = Result.AccessToken
Me.Uid = Result.Uid
Me.Result = True
Catch eww As ArgumentException
' There was an error in the URI passed to ParseTokenFragment
Finally
e.Cancel = True
newAttempt = False
Me.Browser.Navigate("about:blank") ' nav away
Me.Hide()
End Try
End Sub
Could anyone suggest anything to make this work?
BTW: on first run, there is no credential stored so i know this is something to do with cached credentials.