Ticket Created
over 3 years ago

CIQQA-546

Failure of OAuth2 with response code 503 via iPhone.

I have an app that uses makeOAuthRequest as the first step in downloading data from third party websites.

It works like clockwork using my Android phone on two third party sites.

It fails like clockwork using my iPhone on two third party sites.  Each time I get a call back after making the makeOAuthRequest call BUT the responseCode = 503.

Both sites are clearly not temporarily unavailable so I strongly suspect this to be an Apple <=> Garmin issue.

Have any other developers noticed this problem and is it being investigated by Garmin?

const REDIRECT_URI = "https://localhost/ciqauthcallback";  // provided by Final Surge

const RESPONSE_TYPE = "code";  // provided by Final Surge

function requestAuthorisation(){

        Comm.registerForOAuthMessages(mCallbacks.method(:requestAuthorisationResponseHandler));

        var params = {

                  "client-id"=>CLIENT_ID,

                  "redirect-uri"=>REDIRECT_URI,

                  "response-type"=>RESPONSE_TYPE,

        };

        Comm.makeOAuthRequest(

              AUTHORIZE_URI,

              params,

              REDIRECT_URI,

              Comm.OAUTH_RESULT_TYPE_URL,

              {

                     "code" => "code",

                     "error" => "error"

               }

       );

}

Parents
  • I apologize, I was pulled onto something else last week. I wasn't able to reproduce on our Oauth test app so it seems to only be affecting Oauth calls to certain sites hence my question.  After talking to one of our engineers I was wondering if you know if you are still getting the correct response data even with the page returning 503. 

Comment
  • I apologize, I was pulled onto something else last week. I wasn't able to reproduce on our Oauth test app so it seems to only be affecting Oauth calls to certain sites hence my question.  After talking to one of our engineers I was wondering if you know if you are still getting the correct response data even with the page returning 503. 

Children
  • Yes.  The authorisation is returned despite the incorrectly reported code 503.  (I also note that makeWebRequest returns code 2 not 200 or (200-299)).  You need to tidy this up as it wastes developers time.

  • Thanks Rachael.  That is indeed the problem.  Thank you.

    These response codes are important and industry defined RFC 7231

    Why then does Garmin always return 200 (in range 200-299 as expected) in the simulator but:

    • return 2 for successful makewebrequests on devices (not in range 200-299)
    • return 503 for some device/phone combinations

    This sloppiness in coding wastes developers time.  Is there no corporate sense of embarressement? It gives developers a sense of not being valued.  I personally think Garmin would like to ditch the whole CIQ App platform completely but are stuck with it.