Closed gseals closed 4 years ago
Install-Package Microsoft.AspNetCore.Authentication.JwtBearer -Version 3.1.5
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 }; } );
add
using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.IdentityModel.Tokens;
to the top of the file
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" },
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
create a new firebase project
ensure to enable Google login
in
src/helpers/data
create a file calledconnection.js
and fill to mirror this fileyour
App.js
should import firebase and firebase/auth, your firebaseConnection from your helpers, and include your firebase connection. see here for a detailed view of how the firebase section of this page should lookin
src/components/pages
, if you have not already, create a folder calledAuth
and place two files in it calledAuth.js
andAuth.scss
. InAuth.js
, match the way this file is laid outin
src/helpers
, create two files:apiKeys.json
andapiKeys.examples.json
. Fill each as we have before. For a template ofapiKeys.examples.json
see hereMAKE SURE YOU PUT apiKeys.json IN YOUR GITIGNORE like this