oauth2 from chilkat

Hi Guys,

I am trying to understand the use of CHILKAT oauth2 sample

However, I am stucked at this part of the code

//  At this point, your application should load the URL in a browser.
//  For example,
//  in C#:  System.Diagnostics.Process.Start(url);
//  in Java: Desktop.getDesktop().browse(new URI(url));
//  in VBScript: Set wsh=WScript.CreateObject("WScript.Shell")
//               wsh.Run url
//  The Facebook account owner would interactively accept or deny the authorization request.

//  Add the code to load the url in a web browser here...
//  Add the code to load the url in a web browser here...
//  Add the code to load the url in a web browser here...

//  Now wait for the authorization.

I don’t know the replacement from c# to xojo code " System.Diagnostics.Process.Start(url);"
I tried [quote]ShowURL(“https://www.facebook.com”)[/quote] but it wont work.

Please help.

The examples are a tiny bit special. You need a window with a htmlviewer where you simply call to load the url from oauth.

[code]oauth2 = New Chilkat.OAuth2
oauth2.ListenPort = 55568
oauth2.AuthorizationEndpoint = “https://accounts.google.com/o/oauth2/v2/auth
oauth2.TokenEndpoint = “https://www.googleapis.com/oauth2/v4/token
oauth2.ClientId = GetO
oauth2.ClientSecret = GetD
oauth2.CodeChallenge = True
oauth2.CodeChallengeMethod = “S256”
OAuth2.Scope = “https://mail.google.com/

'Begin the OAuth2 three-legged flow.
Dim url As String = oauth2.StartAuth()
If (oauth2.LastMethodSuccess <> True) Then
System.DebugLog(oauth2.LastErrorText)
Return “”
End If

CallDelegateOnMainThreadMBS AddressOf ShowOAuthWindow, url '<------------ load url into window here

'Now wait for the authorization.
Dim numMsWaited As Integer
While numMsWaited < 60000 And oauth2.AuthFlowState < 3
oauth2.SleepMs 100
numMsWaited = numMsWaited + 100
app.SleepCurrentThread(100)
Wend[/code]

However, this is for desktop. Didn’t I read somewhere that this won’t work for web?

Thank you. but the solution seems doesn’t work on web.

I hope somebody will shed a light for my problem.

You can try to ask on the Chilkat forum.