Skip to main content
Question

Can't connect to the service

  • May 21, 2025
  • 5 replies
  • 10 views

Forum|alt.badge.img

Hello!

I have UWP 8.1 app, I integrated box v2.

everything work fine with developer token.

But when I add OAuth2, somethung went wrong.

When I try get access to app (get authCode) openin a new windows woth login. After I click on "locgin" it show me a error :BOX_199fb3ntwel5dd6xn3qlsgxq1r4dw518.png

My redirect Uri is "https://localhost/"

 

How I call acces page:

 

 WebAuthenticationResult war = await WebAuthenticationBroker.AuthenticateAsync(
                WebAuthenticationOptions.None,
                authCodeUri,
                callbackUri);

 

5 replies

Forum|alt.badge.img

What do you have monitoring http://localhost/?


Forum|alt.badge.img

I have never monitor localhost. And dont know what I sholud to see.

I used MS Massage Analyze:

BOX_bk56i3b3uh3508mo4wzgrlljodrpy5sg.png

52 min - open page with login

54 min - click "authorize"

What I have to do? 


Forum|alt.badge.img

When your user is prompted to log into Box and authorizes (or denies) access for the application, the access token is posted to the redirect URL you provide (http://localhost/, for example).  So you grab the access token from that and use it for your subsequent application requests.


Forum|alt.badge.img

I dont understand, how?

I take this code from W8 sample, and in tutorial that code is working fine.

WebAuthenticationResult - just does not reciev enything, And how I said the error throw  before page with access and deny.

But my app with Dev token works fine....


Forum|alt.badge.img

Was this problem ever resolved.  We run into a similar problem but not on all PC's.  Some PC's fail to load the redirect URL, others do this correctly.