Domanda

Sto cercando di costruire un'applicazione di servizio .NET che accedere ad accedere all'aPI di predizione di Google.

Questa applicazione è un servizio (nessuna interazione utente), quindi vorrei sapere come sarebbe possibile autenticare automaticamente ad API di Google (senza aprire un browser in cui accedere e quindi premere "Autorize") .

Cosa ho provato:

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top