cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Access Token

Access Token

knightd23
Explorer | Level 3
Go to solution

Hello,
I would like to know if is possible a person who is not developer get your token?

I ask this because I'm developing an app that can access to any account, for example, in my computer the app needs do access to my account (in the begin I select my account to access), if I pass this app to other person that isn't a developer, this person needs to be able to access your account (not my account) even isn't a developer(in the begin the person select your account to access).

 

Best Regards

20 Replies 20

knightd23
Explorer | Level 3
Go to solution

Hello, 

Thanks for the answer.

I leave then the steps that I follow:

-Open the project the Dropbox.api with Visual Studio;

-Right click in SimpleBlogDemo -> Set as Startup Project

-Open Web.config file and add the APPKEY and APPSECRET to lines 21 and 22 respectively.

-Add in MY APPS Dropbox the http://localhost:5000/Home/Auth in the Redirect URIs of the OAuth2

- Save and press Start button

 

Sometimes gives the error that I described other times open a tab in the browser and after a while time said that is impossible to access to the website.

 

Best Regards

Greg-DB
Dropbox Staff
Go to solution
Thanks! We have managed to reproduce this. It seems the different sample projects can conflict with each other in some cases.

Please try the following to resolve it:
- right click on the SimpleBlogDemo project
- click "Properties"
- click "Web" in the sidebar
- change the port in "Project Url", e.g., from http://localhost:5000/ to http://localhost:5001/
- say yes the resulting pop-up, if you get one
- run the project again

knightd23
Explorer | Level 3
Go to solution

Hello,

 

With your configurations the page opens, request a login register and after I give the permissions to my app allows the access to the simpleblogdemo,  the request the error "Server Error in '/' Application." reappears.

 

Best Regards

Greg-DB
Dropbox Staff
Go to solution
I'm glad to hear that fixed that issue.

Can you share the backend error you're getting for this new problem? Thanks in advance!

Greg-DB
Dropbox Staff
Go to solution

Also, make sure to update the redirect URI to match the new port. 

 

We've now updated the repo in Github to have the two projects point to different ports now to avoid this in the future. Pulling the latest code should fix everything. If not (maybe due to cached files), Properties -> Web -> Create Virtual Directory should fix it.

knightd23
Explorer | Level 3
Go to solution

Hello,

 

Thanks for the answer.

The error gives after I run the program and run the follow steps:

-Appear a web page when I run, that tells to signup now, I press that key

-Next ask to write my email account and password, I wrote;

-In the end has a button which name is "connected", I press this and gives the following error.

 

 

 

Server Error in '/' Application.


The value can't be null.
Parameter name: clientId

Description: Unhandled exception when running the current Web request. Please review the stack trace for more information about the error and the appropriate originated in the code.

Exception Details: System.ArgumentNullException: Value can not be null.
Parameter name: clientId

Source error:

Line 207:            if (string.IsNullOrWhiteSpace(clientId))
Line 208:            {
Line 209:                throw new ArgumentNullException("clientId");Line 210:            }
Linha 211:            


  Source File: ......\dropbox-sdk-dotnet-master\Dropbox.Api\DropboxOauth2Helper.cs    Line: 209

Stack Trace:

[ArgumentNullException: O valor não pode ser nulo.
Nome do parâmetro: clientId]
   Dropbox.Api.DropboxOAuth2Helper.GetAuthorizeUri(OAuthResponseType oauthResponseType, String clientId, Uri redirectUri, String state, Boolean forceReapprove, Boolean disableSignup) in C:\Users\tsf\Documents\dropbox-sdk-dotnet-master\Dropbox.Api\DropboxOauth2Helper.cs:209
   Dropbox.Api.DropboxOAuth2Helper.GetAuthorizeUri(OAuthResponseType oauthResponseType, String clientId, String redirectUri, String state, Boolean forceReapprove, Boolean disableSignup) in C:\Users\tsf\Documents\dropbox-sdk-dotnet-master\Dropbox.Api\DropboxOauth2Helper.cs:181
   SimpleBlogDemo.Controllers.HomeController.Connect() in C:\Users\tsf\Documents\dropbox-sdk-dotnet-master\Examples\SimpleBlogDemo\Controllers\HomeController.cs:176
   lambda_method(Closure , ControllerBase , Object[] ) +61
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +166
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
   System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +22
   System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32
   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +50
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +225
   System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34
   System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +26
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36
   System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +22
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9765121
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

Greg-DB
Dropbox Staff
Go to solution
Thanks! That error indicates that the app key is missing. Make sure you filled in the DropboxAppKey and DropboxAppSecret values in Web.config for that sample app.

knightd23
Explorer | Level 3
Go to solution

Hello,

 

Thanks for the anser.

I really forget to add the APPkey and Secret, that's because I download the last version and not added these values.

I having test the example now and it works good, however after I add files to my blog and if I delete these files in my dropbox, when i'm going to disconnect in the app gives the following error. I'm saying this because can be a problem to someone that need to do this, for me this isn't a problem.

 

Server Error in '/' Application.


The collection was modified; Enumeration operation may not be performed.

Description: Eception unhandled when running the current Web request. Please review the stack trace for more information about the error and the appropriate source in the code.
Exception Details: System.InvalidOperationException: The collection was modified; enumeration operation may not be performed.

Source error:

Line 82:                            select k;
Line 83: 
Line 84:                 foreach (var key in keys)Line 85:                 {
Line 86:                     ArticleCache.Remove(key);


Source File: .....\dropbox-sdk-dotnet-master\Examples\SimpleBlogDemo\Helpers\BlogHelpers.cs    Line: 84

Stack Trace:

[InvalidOperationException: The collection was modified; The enumeration operation may be not performed.]
   System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) +52
   System.Collections.Generic.Enumerator.MoveNext() +12384225
   System.Linq.WhereEnumerableIterator`1.MoveNext() +32
   SimpleBlogDemo.Helpers.BlogHelpers.FlushCache(ControllerBase controller, String blogName) in ....\dropbox-sdk-dotnet-master\Examples\SimpleBlogDemo\Helpers\BlogHelpers.cs:84
   SimpleBlogDemo.Controllers.<DisconnectAsync>d__10.MoveNext() in C:\Users\tsf\Documents\dropbox-sdk-dotnet-master\Examples\SimpleBlogDemo\Controllers\HomeController.cs:154
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) +97
   System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeAsynchronousActionMethod>b__36(IAsyncResult asyncResult) +17
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +48
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32
   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +50
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +225
   System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +48
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34
   System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +26
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +48
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +48
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36
   System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +22
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +48
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +48
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9765121
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

knightd23
Explorer | Level 3
Go to solution

 

Hello,

 

You are right, I forgot to add the APPKEY and Secret in the xml file, because I think I was working with a old folder, however I was working with the new folder that you upload.

 

Other question, when I run the SimpleTest application gives the following error after ask to reset the settings. How can I solve? I already have looking for the URL configuration and I not found.

 

Best Regards

 

Dropbox - 400

Error (400)It seems the app you were using submitted a bad request. If you would like to report this error to the app's developer, include the information below.


More details for developers

Invalid redirect_uri: "https://localhost/authorize": It must exactly match one of the redirect URIs you've pre-configured for your app (including the path).

 

Greg-DB
Dropbox Staff
Go to solution
For that sample, you should add "https://localhost/authorize" as a redirect URI for your app on the App Console:

https://www.dropbox.com/developers/apps
Need more support?