{"id":806,"date":"2016-08-25T19:46:14","date_gmt":"2016-08-25T14:16:14","guid":{"rendered":"http:\/\/new.codingislove.com\/?p=806"},"modified":"2016-08-26T23:14:17","modified_gmt":"2016-08-26T17:44:17","slug":"make-oauth-requests","status":"publish","type":"post","link":"https:\/\/codingislove.com\/make-oauth-requests\/","title":{"rendered":"How to make authenticated OAuth requests"},"content":{"rendered":"<p>If you are using any OAuth secured API like facebook graph API or any of the google APIs, then you might be using an official client library provided by that API to make secure requests.<\/p>\n<p>Have you ever tried to check how those requests are actually authenticated? This quick tip will help you understand that and also learn how to make those requests.<\/p>\n<p>Every OAuth request is authenticated with the help of an access token, Every client library just makes an https request to its API along with the access token.<\/p>\n<p>But how to send the access token in the request? Access token has to be sent in the request header named <code>Authorization<\/code> in the following syntax :<\/p>\n<p><code>Bearer space accessToken<\/code><\/p>\n<h4>Example: <\/h4>\n<p><code>Bearer NsT5OjbzRn410zqLQgV3Ia<\/code><\/p>\n<p>so that header looks like<\/p>\n<p><code>Authorization: Bearer NsT5OjbzRn410zqLQgV3Ia<\/code><\/p>\n<h4>Practical use case:<\/h4>\n<p>I was working on a web app which uses google sign in and an API hosted on google app engine. To check if the API call is actually made by that particular google user, we used access tokens to make authenticated requests to our API and verify the identity of the user.<\/p>\n<div style=\"margin-top: 15px; margin-bottom: 15px;\" class=\"sharethis-inline-share-buttons\" ><\/div>","protected":false},"excerpt":{"rendered":"<p>If you are using any OAuth secured API like facebook graph API or any of the google APIs, then you might be using an official&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":"","jetpack_publicize_message":"How to make authenticated OAuth requests","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[28],"tags":[],"class_list":["post-806","post","type-post","status-publish","format-standard","hentry","category-quick-tips-for-developers"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to make authenticated OAuth requests - Coding is Love<\/title>\n<meta name=\"description\" content=\"This quick tip will help you understand how requests are authenticated by popular APIs like facebook and also learn how to make those OAuth requests.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codingislove.com\/make-oauth-requests\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to make authenticated OAuth requests - Coding is Love\" \/>\n<meta property=\"og:description\" content=\"This quick tip will help you understand how requests are authenticated by popular APIs like facebook and also learn how to make those OAuth requests.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codingislove.com\/make-oauth-requests\/\" \/>\n<meta property=\"og:site_name\" content=\"Coding is Love\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/codingislove\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/ranjithkumar10\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-25T14:16:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-08-26T17:44:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codingislove.com\/wp-content\/uploads\/2015\/12\/codinglovenew.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"225\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ranjith kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codingislove\" \/>\n<meta name=\"twitter:site\" content=\"@codingislove\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ranjith kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/codingislove.com\/make-oauth-requests\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codingislove.com\/make-oauth-requests\/\"},\"author\":{\"name\":\"Ranjith kumar\",\"@id\":\"https:\/\/codingislove.com\/#\/schema\/person\/ecb142505163b016d59bfbe662af587e\"},\"headline\":\"How to make authenticated OAuth requests\",\"datePublished\":\"2016-08-25T14:16:14+00:00\",\"dateModified\":\"2016-08-26T17:44:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codingislove.com\/make-oauth-requests\/\"},\"wordCount\":183,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/codingislove.com\/#organization\"},\"articleSection\":[\"Quick tips for developers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/codingislove.com\/make-oauth-requests\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codingislove.com\/make-oauth-requests\/\",\"url\":\"https:\/\/codingislove.com\/make-oauth-requests\/\",\"name\":\"How to make authenticated OAuth requests - Coding is Love\",\"isPartOf\":{\"@id\":\"https:\/\/codingislove.com\/#website\"},\"datePublished\":\"2016-08-25T14:16:14+00:00\",\"dateModified\":\"2016-08-26T17:44:17+00:00\",\"description\":\"This quick tip will help you understand how requests are authenticated by popular APIs like facebook and also learn how to make those OAuth requests.\",\"breadcrumb\":{\"@id\":\"https:\/\/codingislove.com\/make-oauth-requests\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codingislove.com\/make-oauth-requests\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codingislove.com\/make-oauth-requests\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Coding is Love\",\"item\":\"https:\/\/codingislove.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Quick tips for developers\",\"item\":\"https:\/\/codingislove.com\/category\/quick-tips-for-developers\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to make authenticated OAuth requests\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codingislove.com\/#website\",\"url\":\"https:\/\/codingislove.com\/\",\"name\":\"Coding is Love\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/codingislove.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codingislove.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/codingislove.com\/#organization\",\"name\":\"Coding is Love\",\"url\":\"https:\/\/codingislove.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codingislove.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/codingislove.com\/wp-content\/uploads\/2015\/12\/codinglovenew.png\",\"contentUrl\":\"https:\/\/codingislove.com\/wp-content\/uploads\/2015\/12\/codinglovenew.png\",\"width\":300,\"height\":225,\"caption\":\"Coding is Love\"},\"image\":{\"@id\":\"https:\/\/codingislove.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/codingislove\/\",\"https:\/\/x.com\/codingislove\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/codingislove.com\/#\/schema\/person\/ecb142505163b016d59bfbe662af587e\",\"name\":\"Ranjith kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codingislove.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f5486247269539c638227e6213187139cc7460eeb16d789fa757485f1d2b87f0?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f5486247269539c638227e6213187139cc7460eeb16d789fa757485f1d2b87f0?s=96&d=wavatar&r=g\",\"caption\":\"Ranjith kumar\"},\"description\":\"A CA- by education, self taught coder by passion, loves to explore new technologies and believes in learn by doing.\",\"sameAs\":[\"https:\/\/www.facebook.com\/ranjithkumar10\",\"https:\/\/www.instagram.com\/livin_on_d_edge\/\",\"https:\/\/www.linkedin.com\/in\/ranjithkumar10\",\"https:\/\/www.youtube.com\/c\/codingislove01\"],\"url\":\"https:\/\/codingislove.com\/author\/ranjithkumar10\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to make authenticated OAuth requests - Coding is Love","description":"This quick tip will help you understand how requests are authenticated by popular APIs like facebook and also learn how to make those OAuth requests.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/codingislove.com\/make-oauth-requests\/","og_locale":"en_US","og_type":"article","og_title":"How to make authenticated OAuth requests - Coding is Love","og_description":"This quick tip will help you understand how requests are authenticated by popular APIs like facebook and also learn how to make those OAuth requests.","og_url":"https:\/\/codingislove.com\/make-oauth-requests\/","og_site_name":"Coding is Love","article_publisher":"https:\/\/facebook.com\/codingislove\/","article_author":"https:\/\/www.facebook.com\/ranjithkumar10","article_published_time":"2016-08-25T14:16:14+00:00","article_modified_time":"2016-08-26T17:44:17+00:00","og_image":[{"width":300,"height":225,"url":"https:\/\/codingislove.com\/wp-content\/uploads\/2015\/12\/codinglovenew.png","type":"image\/png"}],"author":"Ranjith kumar","twitter_card":"summary_large_image","twitter_creator":"@codingislove","twitter_site":"@codingislove","twitter_misc":{"Written by":"Ranjith kumar","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codingislove.com\/make-oauth-requests\/#article","isPartOf":{"@id":"https:\/\/codingislove.com\/make-oauth-requests\/"},"author":{"name":"Ranjith kumar","@id":"https:\/\/codingislove.com\/#\/schema\/person\/ecb142505163b016d59bfbe662af587e"},"headline":"How to make authenticated OAuth requests","datePublished":"2016-08-25T14:16:14+00:00","dateModified":"2016-08-26T17:44:17+00:00","mainEntityOfPage":{"@id":"https:\/\/codingislove.com\/make-oauth-requests\/"},"wordCount":183,"commentCount":0,"publisher":{"@id":"https:\/\/codingislove.com\/#organization"},"articleSection":["Quick tips for developers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codingislove.com\/make-oauth-requests\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codingislove.com\/make-oauth-requests\/","url":"https:\/\/codingislove.com\/make-oauth-requests\/","name":"How to make authenticated OAuth requests - Coding is Love","isPartOf":{"@id":"https:\/\/codingislove.com\/#website"},"datePublished":"2016-08-25T14:16:14+00:00","dateModified":"2016-08-26T17:44:17+00:00","description":"This quick tip will help you understand how requests are authenticated by popular APIs like facebook and also learn how to make those OAuth requests.","breadcrumb":{"@id":"https:\/\/codingislove.com\/make-oauth-requests\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codingislove.com\/make-oauth-requests\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/codingislove.com\/make-oauth-requests\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Coding is Love","item":"https:\/\/codingislove.com\/"},{"@type":"ListItem","position":2,"name":"Quick tips for developers","item":"https:\/\/codingislove.com\/category\/quick-tips-for-developers\/"},{"@type":"ListItem","position":3,"name":"How to make authenticated OAuth requests"}]},{"@type":"WebSite","@id":"https:\/\/codingislove.com\/#website","url":"https:\/\/codingislove.com\/","name":"Coding is Love","description":"","publisher":{"@id":"https:\/\/codingislove.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codingislove.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codingislove.com\/#organization","name":"Coding is Love","url":"https:\/\/codingislove.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codingislove.com\/#\/schema\/logo\/image\/","url":"https:\/\/codingislove.com\/wp-content\/uploads\/2015\/12\/codinglovenew.png","contentUrl":"https:\/\/codingislove.com\/wp-content\/uploads\/2015\/12\/codinglovenew.png","width":300,"height":225,"caption":"Coding is Love"},"image":{"@id":"https:\/\/codingislove.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/codingislove\/","https:\/\/x.com\/codingislove"]},{"@type":"Person","@id":"https:\/\/codingislove.com\/#\/schema\/person\/ecb142505163b016d59bfbe662af587e","name":"Ranjith kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codingislove.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f5486247269539c638227e6213187139cc7460eeb16d789fa757485f1d2b87f0?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f5486247269539c638227e6213187139cc7460eeb16d789fa757485f1d2b87f0?s=96&d=wavatar&r=g","caption":"Ranjith kumar"},"description":"A CA- by education, self taught coder by passion, loves to explore new technologies and believes in learn by doing.","sameAs":["https:\/\/www.facebook.com\/ranjithkumar10","https:\/\/www.instagram.com\/livin_on_d_edge\/","https:\/\/www.linkedin.com\/in\/ranjithkumar10","https:\/\/www.youtube.com\/c\/codingislove01"],"url":"https:\/\/codingislove.com\/author\/ranjithkumar10\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","amp_enabled":true,"_links":{"self":[{"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/posts\/806","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/comments?post=806"}],"version-history":[{"count":0,"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/posts\/806\/revisions"}],"wp:attachment":[{"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/media?parent=806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/categories?post=806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/tags?post=806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}