{"id":107139,"date":"2017-12-30T10:03:58","date_gmt":"2017-12-30T10:03:58","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=107139"},"modified":"2017-12-30T10:05:07","modified_gmt":"2017-12-30T10:05:07","slug":"provide-third-party-access-opencart-admin","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/","title":{"rendered":"How to provide third party access to Opencart admin section"},"content":{"rendered":"<p>In this blog we will learn how to get access into the admin section of Opencart after requesting for token from third party.<\/p>\n<p>When we request from any admin controller we have a admin controller URL like http:\/\/example.com\/admin\/index.php?route=extension\/module\/account&amp;token=XdxaPq4y49L7yWDso8ZmIF6yFm0T1Rvh\u00a0 and when we get the token and callback, URL changes to http:\/\/example.com\/admin\/index.php?route=extension\/module\/account<strong>&amp;amp;<\/strong>token=XdxaPq4y49L7yWDso8ZmIF6yFm0T1Rvh by which we redirect to login page as invalid token session.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-107156 size-large\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_1-7-1200x660.png\" alt=\"\" width=\"1200\" height=\"660\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_1-7-1200x660.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_1-7-250x137.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_1-7-300x165.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_1-7-768x422.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_1-7.png 1299w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/p>\n<p>To overcome with this issue we can simply write like this on that controller after getting token<\/p>\n<pre>$location = str_replace('&amp;amp;', '&amp;', $this-&gt;url-&gt;link('extension\/module\/account','token=' . $this-&gt;session-&gt;data['token'], true));\r\n header('Location: '.$location);<\/pre>\n<p>So here we ends with this blog.<\/p>\n<p>Thanks<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog we will learn how to get access into the admin section of Opencart after requesting for token from third party. When we request from any admin controller we have a admin controller URL like http:\/\/example.com\/admin\/index.php?route=extension\/module\/account&amp;token=XdxaPq4y49L7yWDso8ZmIF6yFm0T1Rvh\u00a0 and when we get the token and callback, URL changes to http:\/\/example.com\/admin\/index.php?route=extension\/module\/account&amp;amp;token=XdxaPq4y49L7yWDso8ZmIF6yFm0T1Rvh by which we redirect to <a href=\"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":150,"featured_media":98036,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[305],"tags":[],"class_list":["post-107139","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-opencart"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to provide third party access to Opencart admin section - Webkul Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to provide third party access to Opencart admin section - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"In this blog we will learn how to get access into the admin section of Opencart after requesting for token from third party. When we request from any admin controller we have a admin controller URL like http:\/\/example.com\/admin\/index.php?route=extension\/module\/account&amp;token=XdxaPq4y49L7yWDso8ZmIF6yFm0T1Rvh\u00a0 and when we get the token and callback, URL changes to http:\/\/example.com\/admin\/index.php?route=extension\/module\/account&amp;amp;token=XdxaPq4y49L7yWDso8ZmIF6yFm0T1Rvh by which we redirect to [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-30T10:03:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-30T10:05:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/10\/Magneto-Code-Snippet-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"825\" \/>\n\t<meta property=\"og:image:height\" content=\"260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Aqib Zaman Khan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Aqib Zaman Khan\" \/>\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:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/\"},\"author\":{\"name\":\"Aqib Zaman Khan\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/1650610b7e1967be7161e5b69bab05fa\"},\"headline\":\"How to provide third party access to Opencart admin section\",\"datePublished\":\"2017-12-30T10:03:58+00:00\",\"dateModified\":\"2017-12-30T10:05:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/\"},\"wordCount\":135,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/10\/Magneto-Code-Snippet-1.png\",\"articleSection\":[\"opencart\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/\",\"url\":\"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/\",\"name\":\"How to provide third party access to Opencart admin section - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/10\/Magneto-Code-Snippet-1.png\",\"datePublished\":\"2017-12-30T10:03:58+00:00\",\"dateModified\":\"2017-12-30T10:05:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/10\/Magneto-Code-Snippet-1.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/10\/Magneto-Code-Snippet-1.png\",\"width\":825,\"height\":260,\"caption\":\"Optimisation\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to provide third party access to Opencart admin section\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/1650610b7e1967be7161e5b69bab05fa\",\"name\":\"Aqib Zaman Khan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/209a0dc9c15ab88ae97c2accdc2c929e5242301a36aabcfae7df65e4cacbce85?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/209a0dc9c15ab88ae97c2accdc2c929e5242301a36aabcfae7df65e4cacbce85?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Aqib Zaman Khan\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/aqibzaman-khan651\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to provide third party access to Opencart admin section - Webkul Blog","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:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/","og_locale":"en_US","og_type":"article","og_title":"How to provide third party access to Opencart admin section - Webkul Blog","og_description":"In this blog we will learn how to get access into the admin section of Opencart after requesting for token from third party. When we request from any admin controller we have a admin controller URL like http:\/\/example.com\/admin\/index.php?route=extension\/module\/account&amp;token=XdxaPq4y49L7yWDso8ZmIF6yFm0T1Rvh\u00a0 and when we get the token and callback, URL changes to http:\/\/example.com\/admin\/index.php?route=extension\/module\/account&amp;amp;token=XdxaPq4y49L7yWDso8ZmIF6yFm0T1Rvh by which we redirect to [...]","og_url":"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2017-12-30T10:03:58+00:00","article_modified_time":"2017-12-30T10:05:07+00:00","og_image":[{"width":825,"height":260,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/10\/Magneto-Code-Snippet-1.png","type":"image\/png"}],"author":"Aqib Zaman Khan","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Aqib Zaman Khan","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/"},"author":{"name":"Aqib Zaman Khan","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/1650610b7e1967be7161e5b69bab05fa"},"headline":"How to provide third party access to Opencart admin section","datePublished":"2017-12-30T10:03:58+00:00","dateModified":"2017-12-30T10:05:07+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/"},"wordCount":135,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/10\/Magneto-Code-Snippet-1.png","articleSection":["opencart"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/","url":"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/","name":"How to provide third party access to Opencart admin section - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/10\/Magneto-Code-Snippet-1.png","datePublished":"2017-12-30T10:03:58+00:00","dateModified":"2017-12-30T10:05:07+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/10\/Magneto-Code-Snippet-1.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/10\/Magneto-Code-Snippet-1.png","width":825,"height":260,"caption":"Optimisation"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/provide-third-party-access-opencart-admin\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to provide third party access to Opencart admin section"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/1650610b7e1967be7161e5b69bab05fa","name":"Aqib Zaman Khan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/209a0dc9c15ab88ae97c2accdc2c929e5242301a36aabcfae7df65e4cacbce85?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/209a0dc9c15ab88ae97c2accdc2c929e5242301a36aabcfae7df65e4cacbce85?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Aqib Zaman Khan"},"url":"https:\/\/webkul.com\/blog\/author\/aqibzaman-khan651\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/107139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/150"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=107139"}],"version-history":[{"count":4,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/107139\/revisions"}],"predecessor-version":[{"id":218425,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/107139\/revisions\/218425"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media\/98036"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=107139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=107139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=107139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}