2

I'm trying to build a background application without user interaction, which would synchronize data with Yammer. The problem is - how to authentication it with Yammer, given that there is no user and no browser session. My understanding is that Yammer has no support for this type of applications, running in server background. Is there any workaround?

UPDATE: I've taken a look at Google implementation. They seem to be using OAuth 2.0 "refresh tokens", while it is still necessary to authenticate with browser UI for the first time. Yammer seem not to have those "refresh tokens", but they also don't set validity time for access tokens. This leads me to conclude, that it is necessary to give such "background" apps access token for the first time through some administrative UI, keeping them using this token (or "refresh" token) while they run in background. Is this a valid conclusion?

4

2 回答 2

1

You need to have a user that is able to to access Yammer via their browser to acquire an OAuth token. Once this has been acquired that token is long lived and will be killed off if a user is suspended, or they manually revoke the token.

If I was developing an application that did some kind of background processing:

  • I'd present the user with a way to authenticate in the app.
  • Then I would take the user through the OAuth flow and acquire a token.
  • Finally I'd persist the token acquired for this background user.

This might require you to setup a "service" account in a Yammer network, but that's generally not too big a problem. I guess it depends on what you are trying to build.

于 2013-04-29T22:09:25.773 回答
0

My understanding was same as yours and I had built a custom .Net Web Application that was using Yammer access token. My application was working fine with this access token for more than a month and then, it suddenly stopped working.

After some analysis, I found that the access token had changed. Not sure why and how that happened.

于 2015-01-27T21:00:41.967 回答