{"id":186399,"date":"2021-06-14T23:32:48","date_gmt":"2021-06-15T06:32:48","guid":{"rendered":"https:\/\/m2msupport.net\/m2msupport\/?page_id=186399"},"modified":"2021-06-14T23:32:50","modified_gmt":"2021-06-15T06:32:50","slug":"google-cloud-iot-scopes-cloud-platform-cloud-iot","status":"publish","type":"page","link":"https:\/\/m2msupport.net\/m2msupport\/google-cloud-iot-scopes-cloud-platform-cloud-iot\/","title":{"rendered":"Google Cloud IoT Scopes &#8211; Cloud Platform &#038; Cloud IoT"},"content":{"rendered":"<p>When applications use service accounts to use Google Cloud APIs, they must define scopes which defines the permissions for the application.<\/p>\n<p>The 2 scopes that can be set for applications that are using Google Cloud IoT are,<\/p>\n<ul>\n<li>Cloud Platform &#8211; This permission enables the application to view and manage data across the Google Cloud Platform.<\/li>\n<li>Cloud IoT &#8211; This permission enables the application to register and manage devices in Google Cloud IoT.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/m2msupport.net\/m2msupport\/download-iot-cloud-tester\/\">IoT Cloud Tester<\/a>&nbsp; application enables both the scopes when using the Google API.<\/p>\n<p><a href=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/iot_scopes.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-186402\" src=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/iot_scopes.png\" alt=\"\" width=\"979\" height=\"917\" srcset=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/iot_scopes.png 979w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/iot_scopes-300x281.png 300w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/iot_scopes-768x719.png 768w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/iot_scopes-600x562.png 600w\" sizes=\"auto, (max-width: 979px) 100vw, 979px\" \/><\/a><\/p>\n<p>In the above example, both cloudiot and cloud-platform scopes are added to the Google credential that gets passed to the Google Cloud API call.<\/p>\n<p>ServiceAccountCredentials{clientId=105494402818601193077, clientEmail=iot-479@second-inquiry-315605.iam.gserviceaccount.com, privateKeyId=e79eb513c3f9cd3d154d409c577b5c15c23e3a41, transportFactoryClassName=com.google.auth.oauth2.OAuth2Utils$DefaultHttpTransportFactory, tokenServerUri=https:\/\/oauth2.googleapis.com\/token, scopes=[https:\/\/www.googleapis.com\/auth\/cloudiot, https:\/\/www.googleapis.com\/auth\/cloud-platform], serviceAccountUser=null, quotaProjectId=null}<\/p>\n<div class=\"video-responsive\"><iframe loading=\"lazy\" id=\"youTubePlayer\" src=\"https:\/\/www.youtube.com\/embed\/v6540FuhXlk?hd=1\" width=\"750\" height=\"421\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/div>\n","protected":false},"excerpt":{"rendered":"<p>When applications use service accounts to use Google Cloud APIs, they must define scopes which defines the permissions for the application. The 2 scopes that can be set for applications that are using Google Cloud IoT are, Cloud Platform &#8211; &hellip; <a href=\"https:\/\/m2msupport.net\/m2msupport\/google-cloud-iot-scopes-cloud-platform-cloud-iot\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"iot_tutorial_template.php","meta":{"footnotes":""},"class_list":["post-186399","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/pages\/186399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/comments?post=186399"}],"version-history":[{"count":1,"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/pages\/186399\/revisions"}],"predecessor-version":[{"id":186403,"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/pages\/186399\/revisions\/186403"}],"wp:attachment":[{"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/media?parent=186399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}