Using OAuth 2 with desktop c# Application

前端 未结 1 1435
长发绾君心
长发绾君心 2021-01-01 07:01

I never used oauth before, so i wanted my app to open a url on system\'s default browser, then the user logs in, authorize, etc etc and then i need to send back the authoriz

1条回答
  •  失恋的感觉
    2021-01-01 07:28

    There are multiple options, here are some of them:

    • use a custom URL scheme for a callback URL, e.g. "myapp://callback/after/oauth";
    • deliver authorization code inside of the browser title and watch the browser window title from your application;
    • temporary start a webserver from within your application and use a callback URL "http://localhost:port/".

    Google recommends #2 and #3 for desktop applications. #1 is normally used for mobile: https://developers.google.com/accounts/docs/OAuth2InstalledApp

    0 讨论(0)
提交回复
热议问题