Вопрос

Я пытаюсь построить приложение .NET Service, которое будет получать доступ к API прогнозирования Google.

Это приложение - это услуга (без пользовательского взаимодействия), поэтому я хотел бы знать, как можно будет автоматически пройти аутентификацию на API Google (без того, чтобы открыть браузер, в котором можно входить в систему, а затем нажмите «Авторизация») ,

Что я пробовал:

Это было полезно?

Решение

I've written a sample app (in Python & Java, sorry not available in C#) which authenticates once, stores the OAuth credentials and related data on the server (Google App Engine) and from that point forward reuses those shared credentials, refreshing the access token when needed, without requiring end users to see the OAuth allow/deny dialog, or any other aspect of OAuth.

This still requires the application administrator to execute the OAuth dialog but that's a one-time event. If for some reason you want to reset the stored server credentials, the initialization step can be re-executed on demand via a special URL, however, this reset function is protected so that only the application administrator can make that request, not an end user.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top