Pregunta

After I redirect to the OAuth dialog page, is there a way to authorize use of my account programmatically? Right now, once I enter my username and password, I can get the authorization code and the rest of my app works perfectly, but I want it to automatically authorize use of my account.

Edit: the user will never see any of the account information of course, but according to the api, in order to get the authorization code you need to authorize the account

¿Fue útil?

Solución

The OAuth system is designed so that you cannot log in programmatically, you must display the dialog box to the user for them to log in to SurveyMonkey. However, once a user has logged in once you can then store the access token returned by /oauth/token, and use that to access a user's data whenever you need to.

If all you need to do with your application is access your own data, just store that single access token. When you retrieve it, it is returned in a JSON blob that also defines its expiry - currently SurveyMonkey tokens do not have an expiry (unless a user revokes the access token), so until that changes you can use this access token for as long as you require.

I would suggest checking out the SurveyMonkey OAuth guide for more information: https://developer.surveymonkey.com/mashery/guide_oauth

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top