{"id":785,"date":"2020-05-11T18:10:35","date_gmt":"2020-05-11T09:10:35","guid":{"rendered":"http:\/\/www.typea.info\/blog\/?p=785"},"modified":"2020-10-31T00:00:38","modified_gmt":"2020-10-30T15:00:38","slug":"angluarfirebase-auth-google-twitter","status":"publish","type":"post","link":"https:\/\/www.typea.info\/blog\/index.php\/2020\/05\/11\/angluarfirebase-auth-google-twitter\/","title":{"rendered":"Angluar:Firebase auth \u3067Google\/Twtter\u30ed\u30b0\u30a4\u30f3\u3092\u8a66\u3059"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2020\/04\/04\/firebase-hosting-firestore-release\/\">Firebase Hosting \u306b Angular \u3092\u7d71\u5408\u3057\u3066 Firestore \u306b\u63a5\u7d9a<\/a> \u306b\u3066\u3001Angular\u304b\u3089\u3001Firestore\u3092\u5229\u7528\u3057\u305f\u304c\u3001Flutter\u5074\u306e\u3081\u3069\u304c\u3064\u3044\u3066\u304d\u305f\u306e\u3067\u3001Angular\u306b\u3082\u3069\u3063\u3066\u3001\u8a8d\u8a3c\u3092\u8a66\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Firebase\u306e\u8a2d\u5b9a\u306f\u3001<a href=\"https:\/\/www.typea.info\/blog\/index.php\/2020\/05\/04\/flutter-firebase-auth-twitter-signin\/\">Flutter: Firebase auth \u304b\u3089 twitter \u30b5\u30a4\u30f3\u30a4\u30f3\u3092\u884c\u3046\u3002Android\u3068iPhone<\/a> \u306b\u3066\u5b9f\u65bd\u6e08\u307f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/angular\/angularfire\/blob\/master\/docs\/auth\/getting-started.md\">angularfire<\/a> \u306e\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u306b\u5c11\u3057\u624b\u3092\u52a0\u3048\u3066\u52d5\u4f5c\u78ba\u8a8d\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"598\" height=\"597\" class=\"wp-image-787\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2020\/05\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2020-05-11-17.37.56.png\" alt=\"\" srcset=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2020\/05\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2020-05-11-17.37.56.png 598w, https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2020\/05\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2020-05-11-17.37.56-300x300.png 300w, https:\/\/www.typea.info\/blog\/wp-content\/uploads\/2020\/05\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2020-05-11-17.37.56-150x150.png 150w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><\/figure>\n\n\n\n<pre class=\"prettyprint\">import { Component } from '@angular\/core';\nimport { AngularFireAuth } from '@angular\/fire\/auth';\nimport { auth } from 'firebase\/app';\n\n@Component({\n  selector: 'app-root',\n  template: `\n    &lt;div *ngIf=\"auth.user | async as user; else showLogin\"&gt;\n      &lt;h1&gt;Hello {{ user.displayName }}!&lt;\/h1&gt;\n      &lt;button (click)=\"logout()\"&gt;Logout&lt;\/button&gt;\n    &lt;\/div&gt;\n    &lt;ng-template #showLogin&gt;\n      &lt;p&gt;Please login with Google.&lt;\/p&gt;\n      &lt;button (click)=\"loginGoogle()\"&gt;Login with Google&lt;\/button&gt;\n      &lt;p&gt;Please login with Twitter.&lt;\/p&gt;\n      &lt;button (click)=\"loginTwitter()\"&gt;Login with Google&lt;\/button&gt;\n    &lt;\/ng-template&gt;\n  `,\n})\nexport class AppComponent {\n  constructor(public auth: AngularFireAuth) {\n  }\n  loginGoogle() {\n    this.auth.signInWithPopup(new auth.GoogleAuthProvider());\n  }\n  loginTwitter() {\n    this.auth.signInWithPopup(new auth.TwitterAuthProvider());\n  }\n  logout() {\n    this.auth.signOut();\n  }\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u307e\u3067Flutter+Firebase\u3067\u6e96\u5099\u306b\u6642\u9593\u3092\u304b\u3051\u3066\u304d\u305f\u306e\u3082\u3042\u308b\u306e\u3060\u308d\u3046\u304c\u3001\u3042\u307e\u308a\u306b\u3042\u3063\u3051\u306a\u304f\u52d5\u4f5c\u78ba\u8a8d\u5b8c\u4e86\uff01\uff01<\/p>\n\n\n\n<figure><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/K0eFXgxGIQE\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"\"><\/iframe><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u30a2\u30f3\u30c1 Apple\u3060\u3063\u305f\u3093\u3060\u3051\u3069\u3001<a href=\"https:\/\/www.typea.info\/blog\/index.php\/2020\/04\/04\/macbook-air-early-2015-ssd\/\">Xamarin\u8a66\u3057\u305f\u304f\u3066\u30e1\u30eb\u30ab\u30ea\u3067MBA\u8cfc\u5165<\/a>\u3057\u305f\u3093\u3060\u3051\u3069\u3001\u4f7f\u3044\u3044\u3044\u306a\u3041\u3002\u3084\u3063\u3071\u308a\u3001Unix\u3067\u3001\u30b9\u30e0\u30fc\u30b9\u306b\u30b3\u30de\u30f3\u30c9\u304c\u4f7f\u3048\u308b\u306e\u304c\u30b9\u30c8\u30ec\u30b9\u306a\u304f\u3066\u3044\u3044 \u3002Power Shell\u899a\u3048\u3089\u308c\u306a\u304f\u3066\u6bce\u56de\u3057\u3089\u3079\u306a\u304c\u306b\u306a\u308b\u304b\u3089\u3061\u3087\u3063\u3068\u3044\u3089\u3064\u3044\u305f\u308a\u3002\u7269\u6b32\u304c\u308f\u3044\u3066\u307e\u3046\u3084\u308d\u3002<\/p>\n\n\n\n<p><iframe style=\"width: 120px; height: 240px;\" src=\"\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=typea09-22&amp;language=ja_JP&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=as_ss_li_til&amp;asins=B0863H1JFD&amp;linkId=5a7c1012712b95fa3e3658df55fcf326\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe> <\/p>","protected":false},"excerpt":{"rendered":"<p>Firebase Hosting \u306b Angular \u3092\u7d71\u5408\u3057\u3066 Firestore \u306b\u63a5\u7d9a \u306b\u3066\u3001Angular\u304b\u3089\u3001Firestore\u3092\u5229\u7528\u3057\u305f\u304c\u3001Flutter\u5074\u306e\u3081\u3069\u304c\u3064\u3044\u3066\u304d\u305f\u306e\u3067\u3001Angular\u306b\u3082\u3069\u3063\u3066\u3001\u8a8d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":913,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","footnotes":""},"categories":[102,104],"tags":[],"class_list":["post-785","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-angular","category-firebase"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/785","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=785"}],"version-history":[{"count":10,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/785\/revisions"}],"predecessor-version":[{"id":914,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/785\/revisions\/914"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media\/913"}],"wp:attachment":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}