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

Using invalidated access token results in HTTP 500 Error

This is a feedback rather than a question, as some may be confused by the HTTP response from the following scenario.

I'm using multiple locally stored tokens for multiple users. When I authenticate and store access token for user A, and then refresh user B using user B's refresh token, the access token for user A gets revoked, as I'm aware. Using the invalidated access token for user A, calling intraday activity API endpoint results in an HTTP 500 response with an HTML payload that looks like this: 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Fitbit.com-Error</title>
    </head>
    <body>
        
            <!--
            
            
            
            rid=A29E4F65:4CB5_A92D826B:01BB_5B17F63D_E7694FDC:2558
            -->
            <style>
                body.fb-body {background:url(/images/error_pages/bg_body.png) 0 -11px repeat-x #f6f6f6;}
                .err {width:730px;margin:50px auto 0;color:#888;font:14px Arial, Helvetica, sans-serif;}
                .err:after {overflow:hidden;clear:both;display:block;height:0;content:"";}
                .err a {text-decoration:none;}
                .err a:hover {text-decoration:underline;}
                .err > img {float:left;margin:0 30px 0 0;}
                .err.e505 > img {margin-left:60px;}
                .err .txt {overflow:hidden;width:330px;}
                .err.e505 .txt {width:370px;}
                .err .txt a {color:#3d94f5;}
                .err h1 {margin:93px 0 5px;color:#888;font:bold 44px/46px Arial, Helvetica, sans-serif;}
                .err h1 + p {margin:0 0 7px;line-height:1.5;}
                .err p.bold {margin:70px 0 45px;font-size:15px;font-weight:bold;text-align:center;}
                .err ul {text-align:center;}
                .err li {display:inline-block;width:147px;height:53px;padding:15px 0 0 78px;text-align:left;vertical-align:top;background:url(/images/error_pages/icons_activity.png) no-repeat;}
                .err li + li {background-position:0 -68px;}
                .err li + li + li {background-position:0 -136px;}
                .err li a {color:#58585a;}
            </style>

            <div class="err e505">
                <img class="pic" src="/images/error_pages/error501.png" alt="Error pic"/>
                <div class="txt">
                    <h1 style="margin-top:160px;">Sorry&hellip;<br/> It's not you.<br/> It's us.</h1>
                    <p>We're experiencing an internal server problem.<br/> Please try again later or <a href="http://contact.fitbit.com/">contact support</a>.</p>
                </div>
                <p class="bold">Here are some suggestions to fill your time while we're working on the issue</p>
                <ul>
                    <li><a href="/activities">Take a walk and <br/>get more steps</a></li>
                    <li><a href="/foods/log">Log that snack <br/>you're munching</a></li>
                    <li><a href="/">Track your progress <br/>on the dashboard</a></li>
                </ul>
            </div>
            <script type="text/javascript">
                // this line is for case when it loads by iframe
                $(document).ready(function() {
                    $('a').attr("target", "_top");
                });
            </script>
        
    </body>
</html>

Which is very misleading to the fact that the developer is doing nothing wrong. I believe that the dev should get HTTP 401 error for using invalidated token.

Best Answer
0 Votes
1 REPLY 1

@kanth I can look into why your access token A is getting revoked and the reason for the 500 message.  Would you private message me your client ID and the exact steps your application is taking when the problem occurs.  If you happen to have the user ids for user A and B, that would be helpful too.

 

 

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes