1

I was able to connect and upload videos using the library but when I deleted the app connection on Vimeo.com (as a test) the app didn't authorize again.

the upload looks like it's working but nothing is uploaded as the app is no longer connected.

I deleted the app on the phone and restarted but it still won't re-authorize the app.

This comes up in the output: Vimeo upload state : Executing Vimeo upload state : Finished Invalid http status code for download task.

And this is in OldVimeoUpload.swift: ( didn't include the actual access code!)

import Foundation

class OldVimeoUpload: VimeoUpload
{
static var VIMEO_ACCESS_TOKEN :String! // = "there's a string of numbers here"

static let sharedInstance = OldVimeoUpload(backgroundSessionIdentifier: "") { () -> String? in
return VIMEO_ACCESS_TOKEN // See README for details on how to obtain and OAuth token
}

// MARK: - Initialization

override init(backgroundSessionIdentifier: String, authTokenBlock: AuthTokenBlock)
{
super.init(backgroundSessionIdentifier: backgroundSessionIdentifier, authTokenBlock: authTokenBlock)
}
}

It looks like the access token number is commented out. I deleted the 2 forward slashes to see if that would fix it but it didn't.

1 Answers1

2

I spoke too soon.

It sounds like you went to developer.vimeo.com and created an auth token. Used it to upload videos. And then went back to developer.vimeo.com and deleted the auth token.

The app / VimeoUpload will not automatically re-authenticated in this situation. You've killed the token and the app cannot request a new one for you. You'll need to create a new auth token and plug it into the app.

If this is not accurate and you're describing a different issue let us know.

If you inspect the error that's thrown from the failing request I'm guessing you'll see it's a 401 unauthorized related to using an invalid token.

Edit:

Disconnecting your app (as described in your comment below) has the same effect as deleting your auth token from developer.vimeo.com.

Also, VimeoUpload accepts a hardcoded auth token (as you see from the README and your code sample). It will not automatically re-authenticate, probably ever.

If you'd like to handle authentication in your app check out VimeoNetworking or VIMNetworking. Either of those libraries can be used to create a variety of authentication flows / scenarios. Still, if a logged in user disconnects or deletes their token, you will need them to deliberately re-authenticate (i.e. you will need to build that flow yourself). In that case, the user has explicitly stated that they don't want the app to be able to access information on their behalf. It would go against our security contract with them to automatically re-authenticate somehow.

Does that make sense?

Alfie Hanssen
  • 16,964
  • 12
  • 68
  • 74
  • I went to Vimeo.com (not dev site) /settings/Apps. I clicked "disconnect" in red. Since then it has re-appeared in the app list couple of times(!?). I click disconnect again and still, my app won't reauthorize but it looks like it's uploading. Nothing uploads. – user3634131 May 24 '16 at 00:21