Hi,
We have used the API internally for a while and follow the the OAuth Application flow to do so. We have authorised our own MCC and securely store the refresh token which we pass to the API with our developer token with each request. This process is nice and easy because, right now, all the accounts we access are inside our MCC so we can just keep all the credentials locally.
My question relates how we could release an application externally for others to use and which credentials would need to be distributed with the application.
As I understand it there are 2 parts to the OAuth2 application flow:
1. Having the user authorise our application
2. Using credentials obtained from (1) in order to obtain data from the API for the user's adwords account.
For part 1 I understand that I need to direct the user to the
https://accounts.google.com/o/oauth2/auth URL with a query parameter providing our application's
client-id, yes? Assuming the user gives consent, the application would then capture the authorization code from the redirected page and make a new request to
https://accounts.google.com/o/oauth2/token passing along the authorisation code along with out
client-secret in order to obtain a refresh token, yes?
The result of part 1 is a refresh token which could then be stored on the user's machine ready for use in part 2.
For part 2 I need to pass that locally stored refresh token and our developer-token along in order to authenticate the request (which would be handled inside a client library to ease the exchange of refresh token for authorisation token)
Surely this means that our client-Id, client-secret and developer token must all be distributed with the published application? Should they therefore be encrypted in some way or is it safe to store them 'in the clear' and/or just hard-code them? If encryption is required is there client library support for this part? (specifically the .NET client library?)
Many Thanks