c# - Dwolla oauth access token in windows app -


i creating windows 8 metro app having trouble getting oauth2 access token. can temporary code code fine:

uri requesturi = new uri(string.format(auth_url + "?client_id={0}&response_type=code&scope={1}&client_secret={2}&redirect_uri={3}", client_id, string.join("|", scopelist.toarray()), client_secret, webauthenticationbroker.getcurrentapplicationcallbackuri().absoluteuri));         webauthenticationresult result = await webauthenticationbroker.authenticateasync(webauthenticationoptions.none, requesturi); 

but when try use code permanent access token, either gives me internal server error (500) or times out. gives me 500 when don't have redirect_uri, keep in. otherwise request times out no response code:

private const string token_url = "https://www.dwolla.com/oauth/v2/token"; uri requesturi = new uri(string.format(token_url + "?client_id={0}&client_secret={1}&grant_type={2}&code={3}&redirect_uri={4}", client_id, client_secret, grant_type, code, webauthenticationbroker.getcurrentapplicationcallbackuri().absoluteuri)));         webauthenticationresult result = await webauthenticationbroker.authenticateasync(webauthenticationoptions.silentmode, requesturi); 

all of strings uri escaped. don't know doing wrong.

using besides webauthenticationoptions.silentmode option shows loading browser window

also can't use oauth libraries made c# because use .netframework while windows 8 apps use .netcore, trimmed down version.

any great

the requesturi looks different between temporary code , redirect permananent access token. needs exact same thing.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -