Kimberly-Hart / East-Barley

1 stars 1 forks source link

Firebase Auth #72

Closed gseals closed 4 years ago

gseals commented 4 years ago

User Story

As a user, I should be able to login using Google or with my own unique information.

AC

WHEN I come to the landing page of the website THEN I should see options to log in with Google OR to enter my own information to either create an account OR login with my own unique account

Dev Notes

gseals commented 4 years ago

Install-Package Microsoft.AspNetCore.Authentication.JwtBearer -Version 3.1.5

gseals commented 4 years ago

in Startup.cs, place this below Service.AddCors

var authSettings = Configuration.GetSection("AuthenticationSettings");

services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(options => { options.IncludeErrorDetails = true; options.Authority = authSettings["Authority"]; options.TokenValidationParameters = new TokenValidationParameters { ValidateIssuer = true, ValidIssuer = authSettings["Issuer"], ValidateAudience = true, ValidAudience = authSettings["Audience"], ValidateLifetime = true }; } );

gseals commented 4 years ago

add

using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.IdentityModel.Tokens;

to the top of the file

gseals commented 4 years ago

in appsettings.json, add this below ConnectionStrings and change the identifiers to those particular to your app:

"AuthenticationSettings": { "Authority": "https://securetoken.google.com/fish-store-a71e6", "Issuer": "https://securetoken.google.com/fish-store-a71e6", "Audience": "fish-store-a71e6" },

gseals commented 4 years ago

https://github.com/nss-evening-cohort-9/BranchAndChicken/blob/master/branchandchicken.ui/src/Requests/auth.js