I put together an example that shows how to get OAuth 2.0 bearer and refresh tokens and the process involved. You can download it here:
cstools10-dotnet-oauth2-examples.zip
You'll need the current version of SocketTools, and you'll need to make one change to the include file we provide. When I was writing this, I found a bug in one of the function declarations. What's in the include file right now is this:
And it should be changed to this:
The fourth parameter was declared as BYVAL and it should be BYREF. We'll have that fixed for the next update we release, but in the meantime you'll need to edit the CSTOOLS10.INC include file for this example to work correctly.
cstools10-dotnet-oauth2-examples.zip
You'll need the current version of SocketTools, and you'll need to make one change to the include file we provide. When I was writing this, I found a bug in one of the function declarations. What's in the include file right now is this:
Code:
DECLARE FUNCTION HttpSendResponseW STDCALL LIB "cshtsv10.dll" ALIAS "HttpSendResponseW" ( _ BYVAL hServer AS DWORD, _ BYVAL nClientId AS LONG, _ BYVAL dwOptions AS DWORD, _ BYVAL lpResponse AS HTTPRESPONSEW, _ BYREF lpvBuffer AS DWORD, _ BYVAL dwLength AS DWORD _ ) AS LONG DECLARE FUNCTION HttpSendResponseA STDCALL LIB "cshtsv10.dll" ALIAS "HttpSendResponseA" ( _ BYVAL hServer AS DWORD, _ BYVAL nClientId AS LONG, _ BYVAL dwOptions AS DWORD, _ BYVAL lpResponse AS HTTPRESPONSEA, _ BYREF lpvBuffer AS DWORD, _ BYVAL dwLength AS DWORD _ ) AS LONG
Code:
DECLARE FUNCTION HttpSendResponseW STDCALL LIB "cshtsv10.dll" ALIAS "HttpSendResponseW" ( _ BYVAL hServer AS DWORD, _ BYVAL nClientId AS LONG, _ BYVAL dwOptions AS DWORD, _ BYREF lpResponse AS HTTPRESPONSEW, _ BYREF lpvBuffer AS DWORD, _ BYVAL dwLength AS DWORD _ ) AS LONG DECLARE FUNCTION HttpSendResponseA STDCALL LIB "cshtsv10.dll" ALIAS "HttpSendResponseA" ( _ BYVAL hServer AS DWORD, _ BYVAL nClientId AS LONG, _ BYVAL dwOptions AS DWORD, _ BYREF lpResponse AS HTTPRESPONSEA, _ BYREF lpvBuffer AS DWORD, _ BYVAL dwLength AS DWORD _ ) AS LONG
Comment