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

Trouble with OAuth 2.0 Tutorial -- Workflow clarification

Hi,

 

I have been looking on these forums, but haven't found any posts about my specific issue. Please forgive me if it's already been asked, but I'm mainly looking for clarification.

 

I registered my app as a Read-only Client app with a basic callback, like "http://localhost/callback". I then tried to do the Oauth2.0 tutorial via the link on the Edit Application page.

 

If I just leave everything like it's been generated, and then click on the created hyperlink at the bottom of step 1 (Implicit Grant Workflow); I end up with two different behaviors.

 

The first case I have been dealing with for a week, and that is when I click on the link on Chrome on my Windows 10 PC, I get an HTTP Error 404.0 - Not Found message. I get this "Detailed Error Information": (which I don't understand).

 

Detailed Error Information:

Module -  IIS Web Core
Notification - MapRequestHandler
Handler -  StaticFile
Error Code - 0x80070002
 
Requested URL - http://localhost:80/callback
Physical Path -C:\inetpub\wwwroot\callback
Logon Method -  Anonymous
Logon User -  Anonymous

My Client app, which I coded to do a window.location.replace() to the generated URI has the same behavior when I navigate to it doing an ionic serve (opens app in open Chrome browser). For this reason, I have been stumped as to what I am doing wrong.. I know I'm missing code to handle what happens after I do the replace(), but half the issue is that error or not my code just hammers right through the new window handle and gets caught in an error handler.

 

Case 2, I tried the workflow on my linux PC at work, which is running a really old Chrome browser version.

 

Here, I get an even more unhelpful thing, since it just says "This webpage is not available"... Ok, well whatever, I saw I got "localhost/callback#access_token....<lots of data>" so I just went ahead and copied it into step 2 of the tutorial. That worked. Step 3 I clicked the "Send to Hurl.it" and then on the Hurl.it page, I clicked "Launch Request"... That worked too, and I get a an api.fitbit.com/1/user/-/profile.json object response.

 

So now I'm really confused. I'm not a web developer so I'm chalking this up to me being clueless on what I should expect, but I don't understand what I am doing wrong on my Windows PC which I am using to develop my ionic app.  I was expecting a "Deny/Allow" page to come up from fitbit.com, which I have seen once when clicking the link in Step 1, but I did not get that when I got a good access_token on my linux machine. I'm guessing the "access granted" is a one-time thing that is perpetuated on the fitbit server across different logins on different browser/IP sessions?

 

I'd appreciate any info?

 

Edit: I found that if I just blindly copy and past the URL in the Windows 10 browser page with the 404 error, I can do Step 2 & Step 3 the same as on linux. That still leaves me stumped as to why I get the 404 error though. Is this expected???

Best Answer
0 Votes
0 REPLIES 0