mlenz / dropbox-search

Index and search the contents of your files in Dropbox.
blog.galler.io/dropbox-search
13 stars 1 forks source link

dropbox-search delta issue #1

Open codeRocker10 opened 10 years ago

codeRocker10 commented 10 years ago

Hi

I am trying to search my dropbox file using this project. I am creating oauth key and secret and export it manually . I am using python core api for dropbox But when i am going to run it with index.js its giving me error in delta api

Delta status: 401 : {"error":"Access token not found.","entries":[]}

Plz help me to resolve this problem.

manojdhiman commented 10 years ago

i am facing the same issue ,I am not understanding how to create the oauth key and secret .please help me in this how can i create these credentials .when i put the access token and secret hard-coded it is producing the error

Delta status: 403 : {"error":"Access token does not belong to this app.","entries":[]}

BoxUpp commented 10 years ago

Please create a app in dropbox account and check the key and secret in it and pass it to oauth2.0. And please give the permission to your app to access all data from dropbox.

manojdhiman commented 10 years ago

i have installed oauth1.0a module

manojdhiman commented 10 years ago

i am passing to this like

var oauth = OAuth({ consumer: { public: 'mm0ti477g109m5p', secret: 'yspbdr4ocqjxmx5' }, signature_method: 'HMAC-SHA1' });

in indexer.js . I am very new to node.js and solr. please help me

BoxUpp commented 10 years ago

Sorry I don't have idea about oauth1.0. you can use oauth2.0.I thing the steps are different for authentication in oauth1.0 but parameters are same.

BoxUpp commented 10 years ago

Do one thing Write your on java code for authentication and check it is working or not. Documentation is already on https://www.dropbox.com/developers/core/docs . There is a sequence of steps which you have to follow for oauth1.0

manojdhiman commented 10 years ago

ok thanx . :)

manojdhiman commented 10 years ago

hey i have got the access token and the access secret but now the error is { '{"error": "Request token has not been properly authorized by a user."}': '' } Delta status: 401 : {"error":"Access token not found.","entries":[]}

my code is

var check =dbox.requesttoken(function(status, reply){

login_token.oauth_token_secret=reply.oauth_token_secret;
login_token.oauth_token=reply.oauth_token;

var access_fun=dbox.accesstoken({"oauth_token" : login_token.oauth_token,"app_secret": "yspbdr4ocqjxmx5"},function(status, reply)
{
    console.log(status);
    console.log(reply);
    main();
});
codeRocker10 commented 10 years ago

Now you have to go to a url which is provided by this and accept it after that it will work.

Thanks 'n' Regards Asha Chhikara

On Wed, Jul 30, 2014 at 3:10 PM, manojdhiman notifications@github.com wrote:

hey i have got the access token and the access secret but now the error is { '{"error": "Request token has not been properly authorized by a user."}': '' } Delta status: 401 : {"error":"Access token not found.","entries":[]}

my code is

var check =dbox.requesttoken(function(status, reply){

login_token.oauth_token_secret=reply.oauth_token_secret; login_token.oauth_token=reply.oauth_token;

var access_fun=dbox.accesstoken({"oauth_token" : login_token.oauth_token,"app_secret": "yspbdr4ocqjxmx5"},function(status, reply) { console.log(status); console.log(reply); main(); });

— Reply to this email directly or view it on GitHub https://github.com/mlenz/dropbox-search/issues/1#issuecomment-50594047.

manojdhiman commented 10 years ago

from which function i'll get url, accesstoken function or request token ??

codeRocker10 commented 10 years ago

accesstoken

Thanks 'n' Regards Asha Chhikara

On Wed, Jul 30, 2014 at 3:19 PM, manojdhiman notifications@github.com wrote:

from which function i'll get url, accesstoken function or request token ??

— Reply to this email directly or view it on GitHub https://github.com/mlenz/dropbox-search/issues/1#issuecomment-50594782.

manojdhiman commented 10 years ago

i got the url like dis from requesttoken function https://www.dropbox.com/1/oauth/authorize?oauth_token=dsgfd4534635

i Hot that url in browser this is showing app is connected again same error

codeRocker10 commented 10 years ago

The Main thing is its valid for short amount of time u have to accept it quickly.

Thanks 'n' Regards Asha Chhikara

On Wed, Jul 30, 2014 at 3:26 PM, manojdhiman notifications@github.com wrote:

i got the url like dis from requesttoken function https://www.dropbox.com/1/oauth/authorize?oauth_token=dsgfd4534635

i Hot that url in browser this is showing app is connected again same error

— Reply to this email directly or view it on GitHub https://github.com/mlenz/dropbox-search/issues/1#issuecomment-50595479.

manojdhiman commented 10 years ago

so i need to make a function to authorize it like

authorize: function(options, cb){ var signature = helpers.sign(options) var body = qs.stringify(signature) var args = { "method": "POST", "headers": { "content-type": "application/x-www-form-urlencoded", "content-length": body.length }, "url": "https://www.dropbox.com/1/oauth/authorize", "body": body } return request(args, function(e, r, b){ cb(e ? null : r.statusCode, qs.parse(b)) }) },

codeRocker10 commented 10 years ago

You can't do it like this. you have to browse it.

Thanks 'n' Regards Asha Chhikara

On Wed, Jul 30, 2014 at 3:53 PM, manojdhiman notifications@github.com wrote:

so i need to make a function to authorize it like

authorize: function(options, cb){ var signature = helpers.sign(options) var body = qs.stringify(signature) var args = { "method": "POST", "headers": { "content-type": "application/x-www-form-urlencoded", "content-length": body.length }, "url": "https://www.dropbox.com/1/oauth/authorize", "body": body } return request(args, function(e, r, b){ cb(e ? null : r.statusCode, qs.parse(b)) }) },

— Reply to this email directly or view it on GitHub https://github.com/mlenz/dropbox-search/issues/1#issuecomment-50597829.

manojdhiman commented 10 years ago

i am using node.js and solr for indexing content . I am running the indexing file from terminal so how can user browse the link from browser??