{"id":17,"date":"2022-04-21T17:41:47","date_gmt":"2022-04-21T17:41:47","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/codepark\/?p=17"},"modified":"2022-04-21T17:41:47","modified_gmt":"2022-04-21T17:41:47","slug":"blog-post-4-login","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/codepark\/2022\/04\/21\/blog-post-4-login\/","title":{"rendered":"Blog Post #4 &#8211; Login"},"content":{"rendered":"\n<p>The main goal of this week was for me to get user login to communicate to the back-end. As a team, we agreed that Google Login method would be a good start to this. There are a couple ways to do this, and after a lot of discussion our team came up with three different options to do this. Out of three options, we narrowed it down to two (Option A and Option C). This was a great visual by our team member Ali: <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"792\" height=\"1024\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5462\/files\/2022\/04\/MicrosoftTeams-image-4.jpg\" alt=\"\" class=\"wp-image-19\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5462\/files\/2022\/04\/MicrosoftTeams-image-4.jpg 792w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5462\/files\/2022\/04\/MicrosoftTeams-image-4-232x300.jpg 232w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5462\/files\/2022\/04\/MicrosoftTeams-image-4-768x993.jpg 768w\" sizes=\"auto, (max-width: 792px) 100vw, 792px\" \/><\/figure>\n\n\n\n<p>Option A was basically following this method: <a href=\"https:\/\/petercoding.com\/firebase\/2021\/05\/24\/using-google-sign-in-with-firebase-in-flutter\/\">https:\/\/petercoding.com\/firebase\/2021\/05\/24\/using-google-sign-in-with-firebase-in-flutter\/<\/a>. <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Request:\u00a0<\/strong>The person asks for access to a server or protected resource. That could involve a login with a password, or it could involve some other process you specify.<\/li><li><strong>Verification:\u00a0<\/strong>The server determines that the person should have access. That could involve checking the password against the username, or it could involve another process you specify.<\/li><li><strong>Tokens:<\/strong>\u00a0The server communicates with the authentication device, like a ring, key, phone, or similar device. After verification, the server issues a token and passes it to the user.<\/li><li><strong>Storage:\u00a0<\/strong>The token sits within the user&#8217;s browser while work continues.<\/li><\/ul>\n\n\n\n<p>This is the easiest method and would simply be a matter of passing the user&#8217;s name, email, and whatever else data points we would be sending to the backend for storage. <\/p>\n\n\n\n<p>Option C is the most difficult to set up for front-end, but back-end had already been pretty much set-up this way. I&#8217;ve started to review the youtube videos and text about OAuth, Deep Linking, and redirection from mobile to web browser.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>https:\/\/www.youtube.com\/watch?v=t18YB3xDfXI<\/li><li>https:\/\/www.youtube.com\/watch?v=hHRFjbGTEOk<\/li><li>https:\/\/docs.flutter.dev\/development\/ui\/navigation\/deep-linking<\/li><li>https:\/\/www.oauth.com\/oauth2-servers\/oauth-native-apps\/redirect-urls-for-native-apps\/<\/li><li>https:\/\/www.oauth.com\/oauth2-servers\/mobile-and-native-apps\/<\/li><li><a href=\"https:\/\/www.okta.com\/identity-101\/what-is-token-based-authentication\/\">https:\/\/www.okta.com\/identity-101\/what-is-token-based-authentication\/<\/a><\/li><\/ul>\n\n\n\n<p>Going with option C is requiring some more review and study from me, and tbh I&#8217;m a bit nervous because there&#8217;s not really a guide on how to codify and implement Option C, whereas Option A has everything written up and ready to implement. I&#8217;m also starting to feel uneasy because I haven&#8217;t actually written viable code yet and have only been reviewing and studying, and I don&#8217;t want this to impact or block any of my team&#8217;s work and the timing of our project in any way.<\/p>\n\n\n\n<p>I won&#8217;t give up on Option C just yet because we already have back-end somewhat set-up for this, and this is something I do want and need to learn. So I&#8217;ll do my best with it but if I feel like I won&#8217;t be able to get a PR in a timely manner, at least our team will have Option A.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The main goal of this week was for me to get user login to communicate to the back-end. As a team, we agreed that Google Login method would be a good start to this. There are a couple ways to do this, and after a lot of discussion our team came up with three different [&hellip;]<\/p>\n","protected":false},"author":12312,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/codepark\/wp-json\/wp\/v2\/posts\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/codepark\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/codepark\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/codepark\/wp-json\/wp\/v2\/users\/12312"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/codepark\/wp-json\/wp\/v2\/comments?post=17"}],"version-history":[{"count":2,"href":"https:\/\/blogs.oregonstate.edu\/codepark\/wp-json\/wp\/v2\/posts\/17\/revisions"}],"predecessor-version":[{"id":20,"href":"https:\/\/blogs.oregonstate.edu\/codepark\/wp-json\/wp\/v2\/posts\/17\/revisions\/20"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/codepark\/wp-json\/wp\/v2\/media?parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/codepark\/wp-json\/wp\/v2\/categories?post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/codepark\/wp-json\/wp\/v2\/tags?post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}