{"id":164,"date":"2017-05-15T03:10:12","date_gmt":"2017-05-15T03:10:12","guid":{"rendered":"http:\/\/redquark.com\/wp\/?p=164"},"modified":"2017-05-16T03:10:17","modified_gmt":"2017-05-16T03:10:17","slug":"ios-networking-with-swift-strongly-discouraged-but-it-works","status":"publish","type":"post","link":"https:\/\/redquark.com\/wp\/?p=164","title":{"rendered":"iOS Networking with Swift: Strongly Discouraged, but it Works!"},"content":{"rendered":"<p>At first it appears that the authentication flow has been significantly changed away from the flow presented in Lesson 5: Authentication Requests, because basically it has. Instead of entering in your TMDb credentials (username and password) into the app (where presumably the app could surreptitiously co-opt them), TMDb wants app developers to let TMDb authenticate users directly through their (TMDb&#8217;s) website. You can do this using a segue to an authentication view controller with a web view and a web view delegate, but that is not as spiffy as handling login in your own login view.<\/p>\n<p>But while implementing this new flow, I stumbled across the following URL request:<\/p>\n<pre><span class=\"EndpointMethodUrl-method Method-Type-GET f-0 mr-2\">GET<\/span><span class=\"EndpointMethodUrl-path f-1\">\/authentication\/token\/validate_with_login<\/span><\/pre>\n<p>It is listed as <strong>strongly discouraged<\/strong>, but by golly that is the request that this course is looking to use in the loginWithToken() method, and it still works! I might go back and finish the new authentication flow, since I actually have it fully implemented, but for now I&#8217;m sticking with old school. If you want to go old school too, here is the link to the appropriate documentation:\u00a0<a href=\"https:\/\/developers.themoviedb.org\/3\/authentication\/validate-request-token\">https:\/\/developers.themoviedb.org\/3\/authentication\/validate-request-token<\/a><\/p>\n<p>Also, the instructor&#8217;s notes in step 18 of Lesson 5 include example code on how to use validate-request-token.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At first it appears that the authentication flow has been significantly changed away from the flow presented in Lesson 5: Authentication Requests, because basically it has. Instead of entering in your TMDb credentials (username and password) into the app (where presumably the app could surreptitiously co-opt them), TMDb wants app developers to let TMDb authenticate [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-164","post","type-post","status-publish","format-standard","hentry","category-ios-developer-nanodegree"],"_links":{"self":[{"href":"https:\/\/redquark.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/164","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redquark.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redquark.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redquark.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/redquark.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=164"}],"version-history":[{"count":4,"href":"https:\/\/redquark.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/164\/revisions"}],"predecessor-version":[{"id":168,"href":"https:\/\/redquark.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/164\/revisions\/168"}],"wp:attachment":[{"href":"https:\/\/redquark.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=164"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redquark.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=164"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redquark.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}