{"id":44741,"date":"2023-08-14T07:15:38","date_gmt":"2023-08-28T14:35:13","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8golang%e5%92%8coauth2-0%e4%b8%8egoogle%e4%b8%80%e8%b5%b7%e5%88%9b%e9%80%a0%e5%a5%b9%e3%80%82\/"},"modified":"2024-04-30T18:29:08","modified_gmt":"2024-04-30T10:29:08","slug":"%e4%bd%bf%e7%94%a8golang%e5%92%8coauth2-0%e4%b8%8egoogle%e4%b8%80%e8%b5%b7%e5%88%9b%e9%80%a0%e5%a5%b9%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8golang%e5%92%8coauth2-0%e4%b8%8egoogle%e4%b8%80%e8%b5%b7%e5%88%9b%e9%80%a0%e5%a5%b9%e3%80%82\/","title":{"rendered":"\u4f7f\u7528Golang\u548cOAuth2.0\u4e0eGoogle\u4e00\u8d77\u521b\u9020\u5979"},"content":{"rendered":"<h1>\u76ee\u7684<\/h1>\n<p>\u6211\u662f\u4e00\u4e2a\u4e1a\u4f59\u7684\u5927\u53d4\uff0c\u4f46\u6211\u5b66\u4f1a\u4e86\u5982\u4f55\u4f7f\u7528golang\u548cGoogle\u7684OAuth2.0\u6765\u83b7\u53d6\u7528\u6237\u4fe1\u606f\u3002<\/p>\n<h2>\u6587\u5316\u3001\u793e\u4f1a\u6216\u73af\u5883\u6761\u4ef6\u76f8\u5e94\u7684\u4e8b\u7269\u3002<\/h2>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Google\u63d0\u4f9b\u306eLibrary\u3092\u3061\u3083\u3093\u3068\u4f7f\u3044\u305f\u3044<\/ul>\n<\/li>\n<\/ul>\n<p>Library\u3061\u3083\u3093\u3068\u4f7f\u3063\u305f\u30b5\u30f3\u30d7\u30eb\u304c\u3042\u307e\u308a\u898b\u5f53\u305f\u3089\u305a<\/p>\n<p>\u8aac\u660e\u3092\u7701\u7565\u3057\u306a\u3044\u3067\u52d5\u304f\u30bd\u30fc\u30b9\u3092\u793a\u3057\u3066\u307b\u3057\u3044<\/p>\n<p>\u516c\u5f0f\u30b5\u30a4\u30c8\u3082\u9014\u4e2d\u3067\u300c\u4ee5\u4e0b\u7701\u7565\u300d<\/p>\n<p>\u4f5c\u4e3a\u4e00\u540d\u4e1a\u4f59\u8005\u7684\u6211\u8ff7\u5931\u4e86\u65b9\u5411&#8230; \u7ecf\u8fc7\u4e00\u756a\u8bd5\u9a8c\u548c\u9519\u8bef\uff0c\u603b\u7b97\u5b8c\u6210\u4e86\uff0c\u73b0\u5728\u6211\u5c06\u4ecb\u7ecd\u4e00\u4e0b\u6574\u4e2a\u8fc7\u7a0b\u3002<\/p>\n<h1>\u4e8b\u524d\u9700\u8981\u505a\u7684\u4e8b\u60c5<\/h1>\n<h2>\u56fe\u4e66\u9986<\/h2>\n<p>\u83b7\u53d6Google API\u7684\u5e93<br \/>\ngo get -u google.golang.org\/api\/oauth2\/v2<\/p>\n<h2>\u8c37\u6b4c\u5f00\u53d1\u8005\u63a7\u5236\u53f0 zh\u011b<\/h2>\n<p>\u4eceGoogle\u5f00\u53d1\u8005\u63a7\u5236\u53f0\u83b7\u53d6API\u7684\u51ed\u636e<br \/>\nhttps:\/\/console.developers.google.com\/apis\/<\/p>\n<p>\u5728Credentials\u7684\u6388\u6743\u91cd\u5b9a\u5411URL\u4e2d\uff0c\u6ce8\u518c\u7528\u4e8e\u6b64\u4e8b\u7684\u91cd\u5b9a\u5411URL http:\/\/localhost:5001\/loginr\u3002<\/p>\n<h1>\u63d0\u4f9b\u4e2d\u6587\u8d44\u6599<\/h1>\n<h3>\u5c06\u8fd9\u6837\u7684\u5b69\u5b50\u5f15\u8fdb<\/h3>\n<pre class=\"post-pre\"><code>import (\r\n    \"net\/http\"\r\n    \"log\"\r\n  \"fmt\"\r\n  \"context\"\r\n  \"golang.org\/x\/oauth2\"\r\n  \"golang.org\/x\/oauth2\/google\"\r\n  oauthapi \"google.golang.org\/api\/oauth2\/v2\"\r\n)\r\n<\/code><\/pre>\n<h3>\u9996\u5148\u662f\u767b\u5f55\u9875\u9762<\/h3>\n<p>\u6211\u4f1a\u5236\u4f5c\u4e00\u4e2a\u53ef\u4ee5\u4ece\u4f60\u7684\u9875\u9762\u8df3\u8f6c\u5230Google\u767b\u5f55\u9875\u9762\u7684URL\u3002<\/p>\n<pre class=\"post-pre\"><code>var conf = &amp;oauth2.Config{\r\n  ClientID:     \"Your Client ID\", \/\/\u3042\u306a\u305f\u306e\u3084\u3064\r\n  ClientSecret: \"Your Client Secret\", \/\/\u3042\u306a\u305f\u306e\u3084\u3064\r\n  Scopes:       []string{oauthapi.UserinfoEmailScope},\r\n  Endpoint: google.Endpoint,\r\n  RedirectURL : \"http:\/\/localhost:5001\/loginr\",\r\n}\r\n\r\n\/\/URL\u3092\u4f5c\u308c\u308b\u3088\u3002 yourStateUUID\u306f\u672c\u6765\u306fCSRF\u5bfe\u7b56\u7528UUID\u3092\u5165\u308c\u308b\u3002\r\nconf.AuthCodeURL(\"yourStateUUID\", oauth2.AccessTypeOffline)\r\n<\/code><\/pre>\n<p>\u5982\u679c\u628a\u8fd9\u4e2aURL\u653e\u5728\u4efb\u610f\u7684<a>\u6807\u7b7e\u4e2d\uff0c\u5c31\u53ef\u4ee5\u8df3\u8f6c\u5230Google\u7684\u767b\u5f55\u9875\u9762\u3002<\/a><\/p>\n<p>\u5927\u6982\u5e94\u8be5\u4f1a\u751f\u6210\u8fd9\u6837\u7684URL\uff1a<\/p>\n<p>https:\/\/accounts.google.com\/o\/oauth2\/auth?access_type=offline&#038;client_id=\u4f60\u7684\u5ba2\u6237\u7aefID&#038;redirect_uri=http%3A%2F%2Flocalhost%3A5001%2Floginr&#038;response_type=code&#038;scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&#038;state=\u4f60\u7684\u72b6\u6001UUIDroot@233cc47a021e<\/p>\n<h3>\u91cd\u5b9a\u5411\u9875\u9762<\/h3>\n<p>Google\u5728\u9a8c\u8bc1\u4e4b\u540e\uff0c\u4f1a\u4f7f\u7528\u5e26\u6709\u8bbf\u95ee\u4ee3\u7801\u7684\u91cd\u5b9a\u5411\u65b9\u5f0f\u5c06\u60a8\u91cd\u5b9a\u5411\u5230\u60a8\u6307\u5b9a\u7684\u7f51\u7ad9\uff08\u91cd\u5b9a\u5411URL\uff09\u3002<br \/>\n\u670d\u52a1\u5668\u7aef\u4f1a\u8bfb\u53d6\u8be5\u8bbf\u95ee\u4ee3\u7801\uff0c\u5e76\u4e0eGoogle\u8fde\u63a5\u4ee5\u83b7\u53d6\u7528\u6237\u4fe1\u606f\u3002<\/p>\n<pre class=\"post-pre\"><code>\r\nfunc LoginRHandler(w http.ResponseWriter, r *http.Request) {\r\n  \/\/\u30d1\u30e9\u30e1\u30fc\u30bf\u304b\u3089\u30a2\u30af\u30bb\u30b9\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u53d6\u308a\r\n  code := r.URL.Query()[\"code\"]\r\n  if code == nil ||  len(code) == 0 {\r\n    fmt.Fprint(w,\"Invalid Parameter\")\r\n  }\r\n  \/\/\u3044\u308d\u3044\u308d\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u9811\u5f35\u3063\u3066\r\n  ctx := context.Background()\r\n  tok, err := conf.Exchange(ctx, code[0])\r\n  if err != nil {\r\n  fmt.Fprintf(w,\"OAuth Error:%v\", err)\r\n  }\r\n  \/\/API\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u3067\u304d\u3066\r\n  client := conf.Client(ctx, tok)\r\n  \/\/Userinfo API\u3092Get\u3057\u3066Do\u3057\u3066\r\n  svr, err := oauthapi.New(client)\r\n  ui, err := svr.Userinfo.Get().Do()\r\n  if err != nil {\r\n    fmt.Fprintf(w,\"OAuth Error:%v\", err)\r\n  } else {\r\n    \/\/\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u53d6\u5f97\uff01\r\n    fmt.Fprintf(w, \"Your are logined as : %s\",  ui.Email)\r\n  }\r\n}\r\n<\/code><\/pre>\n<p>\u6211\u8ba4\u4e3a\u53ef\u4ee5\u4ee5\u76f8\u540c\u7684\u65b9\u5f0f\u8c03\u7528\u5404\u79cd\u8c37\u6b4c API\uff0c\u8fdb\u884c\u83b7\u53d6\u5e76\u6267\u884c\u3002<\/p>\n<h3>\u6700\u7ec8<\/h3>\n<p>\u6240\u6709\u6e90\u4ee3\u7801\u5728\u8fd9\u91cchttps:\/\/play.golang.org\/p\/ghQ0_5bdBQ4<\/p>\n<h1>\u62b1\u6b49<\/h1>\n<p>\u5199\u8fd9\u7bc7\u6587\u7ae0\u7684\u662f\u4e00\u4e2a\u5bf9\u73b0\u4ee3\u6587\u660e\u4e0d\u592a\u719f\u6089\u7684\u53d4\u53d4\u3002<br \/>\n\u5728\u6211\u5e74\u8f7b\u7684\u65f6\u5019\uff0c\u6253\u5b54\u5361\u7247\u662f\u4e3b\u6d41\uff0c\u6240\u4ee5\u6211\u5bf9\u952e\u76d8\u548c\u7535\u8111\u90fd\u4e0d\u662f\u5f88\u719f\u6089\u3002\u5982\u679c\u6709\u4efb\u4f55\u9519\u8bef\u6216\u758f\u6f0f\uff0c\u8bf7\u591a\u591a\u5305\u6db5\u5e76\u6e29\u67d4\u5730\u6307\u6b63\uff0c\u6211\u5c06\u4e0d\u80dc\u611f\u6fc0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u7684 \u6211\u662f\u4e00\u4e2a\u4e1a\u4f59\u7684\u5927\u53d4\uff0c\u4f46\u6211\u5b66\u4f1a\u4e86\u5982\u4f55\u4f7f\u7528golang\u548cGoogle\u7684OAuth2.0\u6765\u83b7\u53d6\u7528\u6237\u4fe1\u606f\u3002 \u6587\u5316 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-44741","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4f7f\u7528Golang\u548cOAuth2.0\u4e0eGoogle\u4e00\u8d77\u521b\u9020\u5979 - Blog - Silicon Cloud<\/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:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528golang\u548coauth2-0\u4e0egoogle\u4e00\u8d77\u521b\u9020\u5979\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f7f\u7528Golang\u548cOAuth2.0\u4e0eGoogle\u4e00\u8d77\u521b\u9020\u5979\" \/>\n<meta property=\"og:description\" content=\"\u76ee\u7684 \u6211\u662f\u4e00\u4e2a\u4e1a\u4f59\u7684\u5927\u53d4\uff0c\u4f46\u6211\u5b66\u4f1a\u4e86\u5982\u4f55\u4f7f\u7528golang\u548cGoogle\u7684OAuth2.0\u6765\u83b7\u53d6\u7528\u6237\u4fe1\u606f\u3002 \u6587\u5316 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528golang\u548coauth2-0\u4e0egoogle\u4e00\u8d77\u521b\u9020\u5979\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-28T14:35:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T10:29:08+00:00\" \/>\n<meta name=\"author\" content=\"\u97f5, \u79d1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u97f5, \u79d1\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8golang%e5%92%8coauth2-0%e4%b8%8egoogle%e4%b8%80%e8%b5%b7%e5%88%9b%e9%80%a0%e5%a5%b9%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8golang%e5%92%8coauth2-0%e4%b8%8egoogle%e4%b8%80%e8%b5%b7%e5%88%9b%e9%80%a0%e5%a5%b9%e3%80%82\/\",\"name\":\"\u4f7f\u7528Golang\u548cOAuth2.0\u4e0eGoogle\u4e00\u8d77\u521b\u9020\u5979 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-08-28T14:35:13+00:00\",\"dateModified\":\"2024-04-30T10:29:08+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8golang%e5%92%8coauth2-0%e4%b8%8egoogle%e4%b8%80%e8%b5%b7%e5%88%9b%e9%80%a0%e5%a5%b9%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8golang%e5%92%8coauth2-0%e4%b8%8egoogle%e4%b8%80%e8%b5%b7%e5%88%9b%e9%80%a0%e5%a5%b9%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8golang%e5%92%8coauth2-0%e4%b8%8egoogle%e4%b8%80%e8%b5%b7%e5%88%9b%e9%80%a0%e5%a5%b9%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f7f\u7528Golang\u548cOAuth2.0\u4e0eGoogle\u4e00\u8d77\u521b\u9020\u5979\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\",\"name\":\"\u97f5, \u79d1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"caption\":\"\u97f5, \u79d1\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8golang%e5%92%8coauth2-0%e4%b8%8egoogle%e4%b8%80%e8%b5%b7%e5%88%9b%e9%80%a0%e5%a5%b9%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u4f7f\u7528Golang\u548cOAuth2.0\u4e0eGoogle\u4e00\u8d77\u521b\u9020\u5979 - Blog - Silicon Cloud","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:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528golang\u548coauth2-0\u4e0egoogle\u4e00\u8d77\u521b\u9020\u5979\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u4f7f\u7528Golang\u548cOAuth2.0\u4e0eGoogle\u4e00\u8d77\u521b\u9020\u5979","og_description":"\u76ee\u7684 \u6211\u662f\u4e00\u4e2a\u4e1a\u4f59\u7684\u5927\u53d4\uff0c\u4f46\u6211\u5b66\u4f1a\u4e86\u5982\u4f55\u4f7f\u7528golang\u548cGoogle\u7684OAuth2.0\u6765\u83b7\u53d6\u7528\u6237\u4fe1\u606f\u3002 \u6587\u5316 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528golang\u548coauth2-0\u4e0egoogle\u4e00\u8d77\u521b\u9020\u5979\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-08-28T14:35:13+00:00","article_modified_time":"2024-04-30T10:29:08+00:00","author":"\u97f5, \u79d1","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u97f5, \u79d1","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8golang%e5%92%8coauth2-0%e4%b8%8egoogle%e4%b8%80%e8%b5%b7%e5%88%9b%e9%80%a0%e5%a5%b9%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8golang%e5%92%8coauth2-0%e4%b8%8egoogle%e4%b8%80%e8%b5%b7%e5%88%9b%e9%80%a0%e5%a5%b9%e3%80%82\/","name":"\u4f7f\u7528Golang\u548cOAuth2.0\u4e0eGoogle\u4e00\u8d77\u521b\u9020\u5979 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-08-28T14:35:13+00:00","dateModified":"2024-04-30T10:29:08+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8golang%e5%92%8coauth2-0%e4%b8%8egoogle%e4%b8%80%e8%b5%b7%e5%88%9b%e9%80%a0%e5%a5%b9%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8golang%e5%92%8coauth2-0%e4%b8%8egoogle%e4%b8%80%e8%b5%b7%e5%88%9b%e9%80%a0%e5%a5%b9%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8golang%e5%92%8coauth2-0%e4%b8%8egoogle%e4%b8%80%e8%b5%b7%e5%88%9b%e9%80%a0%e5%a5%b9%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u4f7f\u7528Golang\u548cOAuth2.0\u4e0eGoogle\u4e00\u8d77\u521b\u9020\u5979"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e","name":"\u97f5, \u79d1","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","caption":"\u97f5, \u79d1"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8golang%e5%92%8coauth2-0%e4%b8%8egoogle%e4%b8%80%e8%b5%b7%e5%88%9b%e9%80%a0%e5%a5%b9%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/44741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=44741"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/44741\/revisions"}],"predecessor-version":[{"id":93561,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/44741\/revisions\/93561"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=44741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=44741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=44741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}