Firebase Auth for Flutter

Firebase Auth for Flutter

A Flutter plugin to use the Firebase Authentication API.

To learn more about Firebase Auth, please visit the Firebase website

Getting Started

To get started with Firebase Auth for Flutter, please see the documentation.

Usage

To use this plugin, please visit the Authentication Usage documentation

Issues and feedback

Please file FlutterFire specific issues, bugs, or feature requests in our issue tracker.

Plugin issues that are not specific to Flutterfire can be filed in the Flutter issue tracker.

To contribute a change to this plugin, please review our contribution guide and open a pull request.

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add firebase_auth

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  firebase_auth: ^3.1.1

Alternatively, your editor might support or flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:firebase_auth/firebase_auth.dart'; 

example/lib/main.dart

// ignore_for_file: require_trailing_commas
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_signin_button/button_builder.dart';

import './register_page.dart';
import './signin_page.dart';

// Requires that the Firebase Auth emulator is running locally
// e.g via `melos run firebase:emulator`.
Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  await FirebaseAuth.instance.useAuthEmulator('localhost', 9099);
  runApp(AuthExampleApp());
}

/// The entry point of the application.
///
/// Returns a [MaterialApp].
class AuthExampleApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Firebase Example App',
      theme: ThemeData.dark(),
      home: Scaffold(
        body: AuthTypeSelector(),
      ),
    );
  }
}

/// Provides a UI to select a authentication type page
class AuthTypeSelector extends StatelessWidget {
  // Navigates to a new page
  void _pushPage(BuildContext context, Widget page) {
    Navigator.of(context) /*!*/ .push(
      MaterialPageRoute<void>(builder: (_) => page),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Firebase Example App'),
      ),
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Container(
            padding: const EdgeInsets.all(16),
            alignment: Alignment.center,
            child: SignInButtonBuilder(
              icon: Icons.person_add,
              backgroundColor: Colors.indigo,
              text: 'Registration',
              onPressed: () => _pushPage(context, RegisterPage()),
            ),
          ),
          Container(
            padding: const EdgeInsets.all(16),
            alignment: Alignment.center,
            child: SignInButtonBuilder(
              icon: Icons.verified_user,
              backgroundColor: Colors.orange,
              text: 'Sign In',
              onPressed: () => _pushPage(context, SignInPage()),
            ),
          ),
        ],
      ),
    );
  }
}

Download Details:

Author: FirebaseExtended

Source Code: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_auth/firebase_auth

#flutter  #firebase #auth 

Firebase Auth for Flutter
Antwan  Larson

Antwan Larson

1629832320

How to Create Crypto Wallet App (Auth Page) Using Flutter

Learn How to Create Crypto Wallet App (Auth Page) Using Flutter

▶SourceCode
* Github
https://github.com/PuzzleLeaf/flutter_crypto_wallet_app/tree/auth

▶Timestamp
00:00 - Intro
00:33 - Packages
02:14 - SignUpPage
04:07 - SignUpForm
09:12 - SignInPage
09:51 - SignInForm
12:05 - SignInFormBloc
13:19 - SignInFormState Freezed
16:21 - AuthFacade
21:10 - Injectable
22:35 - SignInFormBloc
30:30 - SignUpFormBloc
35:20 - StartPage


#flutter  #auth  #firebase 

How to Create Crypto Wallet App (Auth Page) Using Flutter
React Tutorial

React Tutorial

1627876760

Building a Netflix Clone with React and Firebase [Source Code]

The stack you will use: React (custom hooks, context, portals), Firebase (Firestore/auth), Compound & Styled components!

In this React Tutorial, we will build a Netflix clone! This React project has multiple pages: Home, Browse (which uses Firebase authentication), sign in, and sign up. The sign in will connect to Firebase when a user tries to sign in, and when a user signs up, we will use Firebase auth to store the user in the Firebase auth database. I built this app using React and uses Styled Components for all the styling we implement. You will need knowledge of React (useEffect, useState, useContext) and you will need JavaScript knowledge for using higher order functions such as map, filter, reduce, and find. We will use Fuse.js for live search, and we will test all our components using React Testing Library. And of course we will use React router for navigation!

--

⌛Timestamps

00:00:00 - Overview/demo
00:04:30 - Architecture
00:08:08 - Project dependencies
00:10:30 - Installing create react app
00:13:03 - Project cleanup
00:21:41 - Yarn/npm port tip
00:24:35 - Creating files/folders
00:29:54 - Creating the Jumbotron component
00:55:19 - Styled components GlobalStyles
00:57:51 - Implementing Normalize.css
00:58:55 - Installing ESLint, Prettier
01:01:33 - Item component
01:03:59 - Item component direction prop
01:05:20 - Container derivative component
01:07:22 - Modules, errors
01:12:00 - Footer component
01:30:28 - Accordion component
01:34:37 - useContext for Compound Components
01:43:29 - VSCode tip for importing
01:55:59 - Accordion component body
02:00:07 - Accordion component review
02:04:14 - Opt-form component creation
02:16:55 - Opt-form component review
02:22:06 - Constants - routes
02:28:57 - Pages: Home, Browse, SignIn, SignUp
02:31:04 - Creating React Router Routes
02:33:23 - Header component
03:09:10 - Template review
03:10:16 - Firebase connection
03:24:14 - React Context for Firebase
03:28:56 - SignIn Page
03:54:52 - Firebase top level authentication
03:58:56 - Firebase console authentication
04:00:25 - Debugging error auth (if user is in the db or not)
04:01:51 - SignUp Page
04:09:22 - Registration page, routes debugging
04:14:42 - Navigation
04:16:00 - Helpers: routes (React router auth)
04:26:21 - Protect routes
04:36:24 - Creating an auth listener (custom hook)
04:40:00 - Tip around authentication state changing
04:44:19 - Helpers routes review
04:47:18 - Browse page (categories films & series) component
04:49:32 - Custom hook:browse page
04:58:02 - Utils directory and setup
05:05:39 - Browse container
05:07:19 - Profiles container
05:12:34 - Profiles component
05:22:06 - Loading profile component
05:31:54 - Spinner review
05:43:19 - Header profile
06:10:50 - Header profile: dropdown, chevron
06:15:45 - Header search styling
06:29:55 - Header play button style
06:35:00 - Card list (categories, slides) - films & series logic
06:55:33 - Entities logic start
06:58:18 - Player component and Card component styling
07:00:58 - Movie recommendations
07:01:01 - Feature component (showing)
07:03:49 - Passing props into our Feature (item obj)
07:06:16 - More styling on the card style
07:20:17 - Debugging the slides
07:30:18 - Debugging play button and card
07:33:07 - Player component
07:48:25 - Review player video
07:49:00 - Live search using Fuse.js
07:53:09 - Review our project!
07:56:44 - Testing setup
08:02:39 - Player test
08:16:04 - Footer test
08:20:19 - Accordion test
08:27:44 - Card test
08:37:24 - Feature test
08:41:24 - Form test
08:49:24 - Opt form test
08:52:04 - Player test
08:52:39 - Loading test
08:57:09 - Profile test
09:01:29 - Jumbotron test
09:06:04 - Header test
09:23:19 - Home page test
09:32:44 - Profiles test
09:34:24 - Adding test-ids to Profiles
09:35:39 - Selection filter test
09:45:24 - SignIn Test
09:55:49 - SignUp Test
09:59:29 - We are done! Review and sign off!

🧨GitHub Repo (remember to star!) https://github.com/karlhadwen/netflix

#netflix #react #firebase #firestore #auth

Building a Netflix Clone with React and Firebase [Source Code]

NestJS JWT Auth Cookie Series - Part-3 - Refresh Token

Hi everyone

This video all about usage steps for refresh tokens in the nestjs application.

The entire session made as a blog:
https://www.learmoreseekmore.com/2021/05/nestjs-jwt-auth-cookie-series-part3-refresh-token.html

Video-1:
https://youtu.be/FmzPjGX7ZxQ
Video-2:
https://youtu.be/uosTBWPuQOU

#naveentechseeker #nestjs #refreshtoken #auth

#nestjs #auth

NestJS JWT Auth Cookie Series - Part-3 - Refresh Token
Rocio  O'Keefe

Rocio O'Keefe

1625973720

Adding Authentication to A Blazor Server App using Auth0

In this post I show how how to add authentication to a sample ASP.NET Core Blazor Server app. The default .NET templates show how to use ASP.NET Identity or Azure for authentication, but in this post I show how to use Auth0 for authentication.

Authentication in Blazor Server

Blazor server is a stateful service. In normal operation, the Blazor server application running on the server maintains a SignalR connection to the user’s browser, and sends diff updates to the browser. However, authentication for SignalR occurs when the connection is established, so you typically need to perform your authentication outside of the normal Blazor Server workflow.

The default .NET templates for Blazor Server use Razor Pages and ASP.NET Core Identity to handle authentication. This is exactly the same as for a typical ASP.NET Core MVC or Razor Pages app, so whether you use Visual Studio or the .NET CLI templates (dotnet new blazorserver) you have all the normal options for authentication, namely:

  • None: No authentication
  • Individual: Individual authentication using ASP.NET Core Identity
  • IndividualB2C: Individual authentication with Azure AD B2C
  • SingleOrg: Organizational authentication (Microsoft account) for a single tenant
  • MultiOrg: Organizational authentication (Microsoft account) for multiple tenants
  • Windows: Windows authentication

For a recent project I was working on I needed accounts, but I didn’t want to manage the user accounts myself, so I didn’t want to use Individual auth. I also didn’t want to require a Microsoft account or Windows, so those options were out. Azure AD B2C would have been feasible, but I decided to opt for an alternative identity provider, Auth0.

Using Auth0 for authentication

Auth0 is an identity provider that you can use to provide user management and authentication for your applications. By using an external login provider such as Auto0 (or Azure AD B2C), you delegate responsibility for the “login process” to a third party. That means you get benefits such as “paswordless” login, compromised password checks, social logins, and WebAuthn support. More importantly, you don’t have to worry about losing user passwords, as you don’t have them!

Using an external identity provider (such as Auth0) is relatively simple with ASP.NET Core, as long as the provider implements  OpenId Connect (which most do). With this approach, whenever you need to login to your app, you redirect the user to Auth0 to do the actual sign-in. Once the user has signed in, they’re redirected to a callback page in your app. Your app then talks directly to Auth0 to obtain the authentication details.

#blazor #auth #asp.net core

Adding Authentication to A Blazor Server App using Auth0

Create a Fullstack Next.js App on AWS | Amplify Storage, Auth, Hosting, and Data

Next.js is an awesome framework for creating server-side rendered and static site generated apps. In this video, we’ll create a fullstack National Park explorer app with Authentication, Storage, a GraphQL API, and then host the server-side rendered app on AWS.

👩🏼‍💻 Links Mentioned 👩🏼‍💻

Blog Post Version of this tutorial - https://welearncode.com/build-a-fullstack-app-nextjs/
Next.js Tutorial - https://www.youtube.com/watch?v=nBkRxwHMrto&t=66s

🌸 My Links 🌸

Blog - https://welearncode.com​​​
Twitter - https://twitter.com/aspittel​​​​
Twitch - https://www.twitch.tv/aspittel​​​​
Portfolio - http://alispit.tel​​​

#next #aws #auth #graphql

Create a Fullstack Next.js App on AWS | Amplify Storage, Auth, Hosting, and Data

Secure servers with Okta: Add Multi-Factor Authentication (MFA)

In this tutorial, you add Multi-Factor Authentication (MFA) to access servers secured with Okta.

This video is part of the Secure servers with Okta (without ssh keys), our series of tutorials on how to secure servers using Okta, eliminating the burden with managing and rotating server keys. Check out the series playlist: https://youtube.com/playlist?list=PLshTZo9V1-aH7Z-r5rEFqCYp6V0wL4LDF

Table of Contents:

  • 00:00 - Introduction
  • 00:19 - Why adding MFA is super important and what we will do?
  • 01:09 - Enabling MFA
  • 02:22 - Configuring access policy
  • 03:10 - Test
  • 04:14 - Wrap up

Secure servers with Okta (without ssh keys): All tutorials:

  1. Introduction https://youtu.be/CGnR_0IdDLw
  2. How to secure a server with Okta https://youtu.be/58rSt748yz4
  3. How to add Multi-Factor Authentication https://youtu.be/6j6X3GFW4P4
  4. How to manage advanced privileges (7/09/2021)
  5. How to integrating with DevOps tools (7/21/2021)

#okta #security #developer #auth

Secure servers with Okta: Add Multi-Factor Authentication (MFA)
Dylan  Iqbal

Dylan Iqbal

1623834163

NextAuth.js - Authentication for Next.js

NextAuth.js

Authentication for Next.js

Open Source. Full Stack. Own Your Data.

Overview

NextAuth.js is a complete open source authentication solution for Next.js applications.

It is designed from the ground up to support Next.js and Serverless.

Getting Started

npm install --save next-auth

The easiest way to continue getting started, is to follow the getting started section in our docs.

We also have a section of tutorials for those looking for more specific examples.

See next-auth.js.org for more information and documentation.

Features

Flexible and easy to use

  • Designed to work with any OAuth service, it supports OAuth 1.0, 1.0A and 2.0
  • Built-in support for many popular sign-in services
  • Supports email / passwordless authentication
  • Supports stateless authentication with any backend (Active Directory, LDAP, etc)
  • Supports both JSON Web Tokens and database sessions
  • Designed for Serverless but runs anywhere (AWS Lambda, Docker, Heroku, etc…)

Own your own data

NextAuth.js can be used with or without a database.

  • An open source solution that allows you to keep control of your data
  • Supports Bring Your Own Database (BYOD) and can be used with any database
  • Built-in support for MySQL, MariaDB, Postgres, Microsoft SQL Server, MongoDB and SQLite
  • Works great with databases from popular hosting providers
  • Can also be used without a database (e.g. OAuth + JWT)

Secure by default

  • Promotes the use of passwordless sign in mechanisms
  • Designed to be secure by default and encourage best practice for safeguarding user data
  • Uses Cross Site Request Forgery Tokens on POST routes (sign in, sign out)
  • Default cookie policy aims for the most restrictive policy appropriate for each cookie
  • When JSON Web Tokens are enabled, they are signed by default (JWS) with HS512
  • Use JWT encryption (JWE) by setting the option encryption: true (defaults to A256GCM)
  • Auto-generates symmetric signing and encryption keys for developer convenience
  • Features tab/window syncing and keepalive messages to support short lived sessions
  • Attempts to implement the latest guidance published by Open Web Application Security Project

Advanced options allow you to define your own routines to handle controlling what accounts are allowed to sign in, for encoding and decoding JSON Web Tokens and to set custom cookie security policies and session properties, so you can control who is able to sign in and how often sessions have to be re-validated.

TypeScript

NextAuth.js comes with built-in types. For more information and usage, check out the TypeScript section in the documentation.

The package at @types/next-auth is now deprecated.

Example

Add API Route

import NextAuth from 'next-auth'
import Providers from 'next-auth/providers'

export default NextAuth({
  providers: [
    // OAuth authentication providers
    Providers.Apple({
      clientId: process.env.APPLE_ID,
      clientSecret: process.env.APPLE_SECRET
    }),
    Providers.Google({
      clientId: process.env.GOOGLE_ID,
      clientSecret: process.env.GOOGLE_SECRET
    }),
    // Sign in with passwordless email link
    Providers.Email({
      server: process.env.MAIL_SERVER,
      from: '<no-reply@example.com>'
    }),
  ],
  // SQL or MongoDB database (or leave empty)
  database: process.env.DATABASE_URL
})

Add React Component

import {
  useSession, signIn, signOut
} from 'next-auth/client'

export default function Component() {
  const [ session, loading ] = useSession()
  if(session) {
    return <>
      Signed in as {session.user.email} <br/>
      <button onClick={() => signOut()}>Sign out</button>
    </>
  }
  return <>
    Not signed in <br/>
    <button onClick={() => signIn()}>Sign in</button>
  </>
}

Acknowledgements

NextAuth.js is made possible thanks to all of its contributors.

Powered By Vercel

Thanks to Vercel sponsoring this project by allowing it to be deployed for free for the entire NextAuth.js Team

Contributing

We’re open to all community contributions! If you’d like to contribute in any way, please first read our Contributing Guide.

Download Details:

Author: nextauthjs
The Demo/Documentation: View The Demo/Documentation
Download Link: Download The Source Code
Official Website: https://github.com/nextauthjs/next-auth
License: ISC

#next #security #auth #react #javascript

NextAuth.js - Authentication for Next.js

Learn Flutter With Smrity

Made by Learn Flutter With Smrity

Configuration
This project works with Firebase so you need to import your own Google Services files on Android & iOS folder after creating your Firebase project. Remember to enable multidex in your flutter project.

Author: Smrity

View Full Explanation in Youtube:
Episode 1: Setup Firebase in Flutter project https://www.youtube.com/watch?v=QeJbtaEeA1g
Episode 2: Login & Registration bloc pattern https://www.youtube.com/watch?v=UvfR3MrCsUI
Episode 3: Implement Login & Registration functionality with Beautiful Ui https://www.youtube.com/watch?v=WQnQeZw9Sf0
Episode 4: Store , Retrieve User data from Cloud Firestore https://www.youtube.com/watch?v=Waka0NK2oCA

Subscribe to get more : https://www.youtube.com/channel/UCxcvg9qQNzy7jfdON6AwYOg

#flutter #dart #firebase #auth

Learn Flutter With Smrity

SwiftUI Firebase Auth using firebase-ios-sdk

Learn about SwiftUI Firebase Auth using firebase-ios-sdk

Source Code : https://tutorial101.blogspot.com/2021…

Subscribe: https://www.youtube.com/c/Cairocoders/featured

#swiftui #auth

SwiftUI Firebase Auth using firebase-ios-sdk
Desmond  Gerber

Desmond Gerber

1617880860

Securing a Go Microservice with JWT

Securing a Go Microservice with JWT

JSON Web Tokens (JWTs) offer a mechanism to share a set of claims or attributes from client to a server providing microservices in a cryptographically secure way. JWT secures the service-to-service communication and also can pass end-user context across microservices.

A JWT token can be used to carry the identity of the calling microservice, or the identity of the client or the system which initiated the request. It can be used to communicate authorization and validation attributes between multiple clients and servers. Using such attributes secures the microservices and makes sure that only authorized access occurs.

In this post, we are going to explore the role that JWT plays in securing service-to-service communication in an example golang microservices deployment. In the golang programming ecosystem, there is an open source jwt-go package that enables us to generate the JWT token.

First, we are going to use this package to generate the JWT token and create an endpoint API that serves the token. You also could generate the JWT using an auth system such as FusionAuth, but it can be educational to see how JWTs are created at a lower level.

Then, we will be creating the microservice server. There will be an authorization middleware that will execute before access is allowed to the golang microservices. This middleware will take the JWT token and validate it to ensure authorized access to the microservices.

So, let’s get started!

Prerequisites

  • Install  Golang 1.15.8
  • Basic knowledge of JWT based authentication
  • Basic knowledge of golang programming

#jwt #golang #microservices #auth

Securing a Go Microservice with JWT
Devan  Johnson

Devan Johnson

1605757937

Hanami with OAuth

At Monterail we like to try new stuff. We try new languages and new (maybe not so new) frameworks.

Hanami (formerly Lotus) is a Ruby web framework created by Luca Guidi and community.

Probably the most problematic thing for people trying hanami after experience with rails is changing your mind away from the rails way. I can write many good things about hanami, but now I want to resolve one problem - authentication. The popular question is, What about users? In rails, we have devise which is a great gem but it is Rails only. In hanami, you can use other (non rails) user solutions. But sometimes you don’t need all this devise stuff and omniauth is enough (like in our internal apps).

Step 1 - create new project

I guess you have some application already, but I’ll create a new one.

hanami new hanami_oauth --test=rspec

For this tutorial we don’t need any db (File System is the default adapter, so everything will be saved in file).

Step 2 - add user

The generator will create all necessary files.

bundle exec hanami generate model user
create  lib/hanami_oauth/entities/user.rb
create  lib/hanami_oauth/repositories/user_repository.rb
create  spec/hanami_oauth/entities/user_spec.rb
create  spec/hanami_oauth/repositories/user_repository_spec.rb

Hanami uses hanami-model, but you can replace it with any other ORM. As we do not have any database we will not need migrations, but we must make some changes to our model.

Edit file: /lib/hanami_oauth.rb

Hanami::Model.configure do

...

  mapping do
    collection :users do
      entity     User
      repository UserRepository

      attribute :id,   Integer
      attribute :name, String
      attribute :github_id, String
      attribute :email, String
    end
  end
end

Next, edit file: lib/hanami_oath/entities/user.rb

class User
  include Hanami::Entity
  attributes :id, :name, :github_id, :email
end

#auth #hanami #ruby/rails #development

Hanami with OAuth
Alec  Nikolaus

Alec Nikolaus

1602889200

Building a User Profile Portal With Flask, OAuth, and APIs

Once a user registers, you can view their data in the administrative user interface. But how can you allow the user to view or change their data themselves?

Previously, we built a self service registration form for a real estate application. It was a two step form which captured specific information about their home buying needs. We also themed the registration form. This tutorial builds on the previous two and will walk through building a python flask application to let a user sign in and modify the profile data they provided at registration.

While this tutorial will reference the previous registration form, you can adapt it to an existing registration flow too.

This is part of a three part series. Here are all the posts:

  1. How to use FusionAuth’s advanced registration forms
  2. How to theme FusionAuth’s advanced registration forms
  3. Building a user profile portal with Flask, OAuth, and APIs (this one)

Overview

Before jumping into the code, let’s outline what this blog post will cover. You’ll learn how to set up a Flask application to use FusionAuth as a user data store. This post will only have one application and one tenant, but FusionAuth supports multiple tenants and applications out of the box, so if you need that logical separation, you got it.

The Flask application will let users log in or register. After a user has been authenticated, it will display their profile information. This data will be retrieved in two ways, using both a standards based python OAuth library, requests_oauthlib, and with the FusionAuth open source python client library.

Why two ways? If all you need is data that is provided by an OpenID Connect (aka OIDC), then you should stick with standards, as this will give you maximal portability. requests_oauthlib can easily retrieve an access token that your software can present to other services which expect credentials. These may be APIs you build or any other applications which use JWTs for authorization decisions.

What’s the difference between OAuth and OIDC? OAuth is a standardized framework for authorization which delivers tokens to present to other systems to gain access. OIDC is another standardized framework built on top of OAuth which provides user data and authentication information.

However, if you need information beyond what OIDC provides, you will need to use a different approach. An example of such data is the home pricing preference information captured by the registration form built previously. To access this data, you’ll need to use the FusionAuth client libraries.

At the end of the day, you’ll end up with a self service portal like this:

Image for post

Prerequisites

You’ll need the following pieces of software installed before you start this tutorial:

  • python3
  • pip3

And of course you’ll need to have a registration form and FusionAuth set up. If you want to be walked through that process, check out the previous post on advanced registration forms and on theming the form. If you already have a form set up, full speed ahead!

#oauth #python3 #auth #flask

Building a User Profile Portal With Flask, OAuth, and APIs
Fredy  Larson

Fredy Larson

1602694920

Centralized authentication with a microservices gateway

In this article, we’re going to implement authentication and authorization for a gateway API application that routes to two different microservices. FusionAuth will be the auth server for the gateway.

An API gateway with microservices is a common pattern for enterprise architectures. In this post, we’ll pretend we’re setting this up for an eCommerce enterprise. Our gateway application is a central API that will control access to a product catalog service and a product inventory service. We’ll allow customers to access public endpoints but require authentication for some of the product inventory endpoints.

For this article, we’re going to need a running FusionAuth instance and three simple Node/Express applications. You can download the example project for this article and customize your FusionAuth configuration accordingly, or you can follow along conceptually.

If you want to follow along, it will be very helpful to go through the 5-Minute Setup Guide first, as that will set up the needed users and roles in FusionAuth.

We’re going to have four applications running, on the following ports:

  • FusionAuth: 9011
  • Gateway Application: 3000
  • Product Catalog Service: 3001
  • Product Inventory Service: 3002

We’re also going to be dealing with authentication and authorization quite a bit, so let’s briefly clarify what we mean by these terms.

Authentication and authorization

Authentication is the verification of a particular user. When a user is logged in, they’re saying to the application, “Hey, it’s the real John Doe, let me in.” The application validates their credentials, and they have access.

In our API gateway, we’re going to use FusionAuth, based on the 5-Minute Setup Guide as mentioned above. We’ll talk about specific details when we set up our API gateway application later.

Authorization is the process whereby we verify that a particular user (e.g. John Doe) has access to certain parts of our system (e.g. product inventory). In our eCommerce ecosystem, we’re going to require authorization for the product inventory API, but not for the basic product APIs, since we want everyone to access the latter. For the product inventory route, we’ll allow users with the “admin” role access.

#microservices #authentication #auth

Centralized authentication with a microservices gateway