The Community is undergoing a major upgrade. Find out more, ask us questions or share your thoughts here.
Forum Discussion
Shy1
3 years agoExplorer | Level 3
Exchanging code for token
I already have a topic, but I asked the wrong question and messed everything up. I think me need to create the right thread for the right question
here is the code taken from the official dropbox ...
Greg-DB
Dropbox Staff
It looks like you're attempting to run the "OauthBasic" example from the Dropbox .NET SDK here. That's an example meant to show how a server-side app can process the OAuth app authorization flow to receive an access token and refresh token for making API calls.
I understand that can be tricky to set up from scratch, so I do recommend running that sample as provided without modifications first, other than plugging in your app key/secret and potentially different port number.
It sounds like you've done so, that is, are running the example unmodified except for app key/secret and port, and are receiving an error during the ProcessCodeFlowAsync call. Is that correct?
If so, can you show the full error you're getting? I would generally expect the error to contain more information than just that message, though you may need to inspect the exception object a bit. Feel free to share a screenshot if that would better illustrate what you're currently seeing. Thanks in advance!
Shy1
3 years agoExplorer | Level 3
Spoiler
Помощник по отладке управляемого кода "DisconnectedContext" : "Переход к COM-контексту 0x7c6698 для данного объекта RuntimeCallableWrapper завершился следующей ошибкой: Исключение из HRESULT: 0xE0434352. Обычно это происходит из-за того, что COM-контекст 0x7c6698, в котором был создан этот объект RuntimeCallableWrapper, отключен или занят другой операцией. Выполняется освобождение интерфейсов из текущего COM-контекста (COM-контекст 0x7c6750). Это может привести к повреждению или потере данных. Для устранения этой проблемы убедитесь в том, что все контексты, подразделения и потоки будут существовать и оставаться доступными для перехода к контексту до полного завершения работы приложения с объектами RuntimeCallableWrapper, представляющими находящиеся в них COM-компоненты."
sorry for not english error if you believe the error, then it reports that the COM context is busy or disabled.
and its was happen at the var redirectUri = await HandleJSRedirect(http); and next was catch the exception
InnerException = {"The request was aborted: Failed to create SSL/TLS secure channel."}
StackTrace = " в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n в System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.Configur...
maybe I took the wrong example? maybe you can tell me how to connect to the API in an easier way? I’m not very strong in this, I practically don’t understand anything, I have an xamarin application that I would like to save the picture and download it when needed, maybe I approached the connection issue incorrectly or its correct way?
- Greg-DB3 years agoDropbox Staff
I see you're getting an error "Failed to create SSL/TLS secure channel", which indicates your system wasn't able to establish a secure connection to the Dropbox API servers for the HTTPS requests needed to perform API calls. This may be because your system doesn't support a sufficient version of TLS.
For reference, Dropbox retired support for TLS 1.0 and 1.1 earlier this year. The Dropbox API servers now only support connections using TLS 1.2. You'll need to make sure your app/network client/environment support TLS 1.2 in order to continue making Dropbox API calls.
For your client/environment, please refer to the relevant documentation for information on enabling the relevant platform support. For example, Microsoft in particular appears to have some resources here which may be helpful: - Shy13 years agoExplorer | Level 3
if be clear OAthTest OAtestPCKE SimpleTest all code throw errors at about one moment, could it be that I didn’t set up something on the computer from not knowing? The problem is that if I manually go all the way through the browser then I get a response and I get the code in the browser window and I think if I copy it by hand and paste it into ReadLne it could work, but what am I doing wrong or what I have a problem, can I record a video of how I work with this?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,875 PostsLatest Activity: 42 minutes agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!