rubenfonseca / titanium-dropbox

Titanium Dropbox module for iOS
MIT License
13 stars 6 forks source link

Authorization without login window? #3

Open annakozy2011 opened 9 years ago

annakozy2011 commented 9 years ago

I know it's insecure and everything, but we need it.

I changed the "link" function in Com0x82DropboxSessionProxy.m at the end (last 2 lines) in this way and it seems to work (if I supply the token and the secret, it does silent authorization, if not, it just does what it did before) Could you please check it and if possible introduce into the main code?

id accesskey = [args objectForKey:@"accesskey"]; id accesssecret = [args objectForKey:@"accesssecret"]; id userid = [args objectForKey:@"userid"];

if (accesskey == nil || accesssecret == nil)
{
    UIViewController *currentVC = [TiApp controller];
    [[DBSession sharedSession] linkFromController:currentVC];
}
else
{
    session = [[DBSession alloc] initWithAppKey:key appSecret:secret root:root];
    session.delegate = self;
    [DBSession setSharedSession:session];
    [session updateAccessToken:accesskey accessTokenSecret:accesssecret forUserId:userid];
}
rubenfonseca commented 9 years ago

Since this is basically undocumented functionality, and as you said, is a completely wrong security practice anyway, I'm not really wiling to add the code to this project.