To use grant flow in a desktop application, you can start a webserver on the user’s machine on a high numbered port, then set your redirect url to 127.0.0.1:. That way you can open the oauth flow in the user’s browser, have it redirect to the webserver being run by your app, which can then save the oauth token and close the browser. Unfortunately I do not know of any sample code for this.
1 Like