Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Fullstack GoLang React OAuth Flow w/ Node Included
Rating: 3.8 out of 5(8 ratings)
1,136 students

Fullstack GoLang React OAuth Flow w/ Node Included

Build our own custom Oauth Framework.
Created byZach LaCourse
Last updated 5/2020
English
English [Auto],

What you'll learn

  • Oauth with GoLang and Node

Course content

12 sections119 lectures13h 6m total length
  • Install & Configure NGinx w/ Lets Encrypt11:00

    Learn to install and configure nginx behind Let's Encrypt, create and enable site configurations, proxy Keycloak, set up 80-to-443 redirects, and obtain SSL certificates for secure web traffic.

  • Install JDK1:31

    Install the JDK by running apt-get install after locating the latest openjdk version with apt search, then verify the installation by checking the Java version on Ubuntu 19.10.

  • Download and Configure Keycloak6:30

    download and extract keycloak, rename the folder, and run the standalone server. bind to 0.0.0.0 for external access and set up nginx to proxy requests securely.

  • Secure Keycloak with HTTPS / Configure Admin User6:10

    Configure engine X to proxy traffic from port 7000 to Keycloak on port 88 behind https. Create an admin user to secure access, then restart services and verify the setup.

  • Install Go Configue Web App directory3:25

    Start building a keycloak-secured go web app by configuring a new directory, installing go, initializing a module named go cloak server, and linking the go binary to the system path.

  • Finish Go Dev Environment Compile First Go App4:15

    Configure a dedicated Go environment using go mods and a PATH profile, update your bash profile, and test package placement with a hello world app.

  • Code Run Isomorphic TLS Webserver7:26

    Build a self-contained Go web server that serves static content, uses TLS and connects to a Keycloak server, using Gorilla Mux to define routes and run on a configured port.

  • Add Index Template and Test3:42

    Create an index template in a templates folder, wire it to the Go template library, render it to a web page, and experiment with passing objects into the template.

  • Create Keycloak Realm and Client Application4:47

    Create a Keycloak realm and a client application, start the server, and configure the admin console to enable token requests and access to server resources.

  • Create Keycloak User1:37

    Create a user in the Keycloak system with a simple temporary password, then set up the client login using the client id and secret.

  • Code Keycloak login route15:29

    Set up the Keycloak login route by configuring the client ID and secret, implement the authorization code grant, and manage redirects and callbacks to obtain access tokens.

  • Parse Code and SessionState from URl and Redirect Home5:52

    Parse code and session state from the OAuth redirect URL, store them in variables with a dedicated handler, and redirect home, illustrating how to build a custom framework.

  • Exchange Code for Access Token Part I7:10

    Learn how to exchange an authorization code for an access token in a Go/React OAuth flow, including crafting POST requests with grant_type, client credentials, and handling the token response.

  • Exchange Code for Access Token Part II5:20

    Practice exchanging an authorization code for an access token in a GoLang React OAuth flow Part II, printing, inspecting tokens, and building a struct to hold access token data.

  • Exchange Code for Access Token Part III3:42

    Define a Go struct for the access token, marshal token data into it, store it in app variables and SQL structures, then use the token to access a protected resource.

  • Display App Session Data on Page3:26

    Demonstrate displaying app session data on a page by wiring a Go server and template, pulling access token, refresh token, and scope from the app state for rendering.

  • Pretty up the page a little7:53

    Enhance the page by applying Google fonts, turning the layout into a grid, updating the template, and testing a cleaner interface with login and custom styling.

  • Add Loutout Functionality6:31

    Add logout functionality by wiring a logout route and redirect URL, redirecting users to the logout endpoint and clearing all session data to return to the login state.

  • Quick Fix0:49

    Apply a quick fix to the app bar and redirect handling in the fullstack GoLang React OAuth flow, ensuring logon, reauthorization, and token exchange work when returning home.

  • Prepare the stage for resource gathering1:59

    Sets up a root for systems and a resource server, and defines a client route and an api route to request a systems resource and obtain an access token.

  • Start Filling out Systems Resource Request9:04

    Set up a systems resource endpoint that returns a json array of hosts and ports by extracting and validating a token, then render the results on the client page.

  • Systems Resource Call Part II8:11

    Implement the systems resource call by adding the authorization bearer token, sending a prepared request, handling errors, unmarshalling JSON into a hive struct, and rendering the results for the UI.

  • Systems Resource Call Part III11:28

    Learn how to extract an access token from headers, body, or query parameters, handle bearer tokens, validate and print errors, and fetch system data using a token-based request flow.

  • Systems Resource Call Part IV4:38

    Learn to validate tokens by sending them to the token introspection endpoint on the key store server via a post request with url-encoded form values and headers.

  • Create Token Authentication Client And Implement Validation16:25

    Create a token authentication client on a Keycloak server to validate tokens via introspection, enforce bearer-only access, and verify audiences.

  • Deeper Look at Audience and Scope1:53

    Verify the token audience, configure scopes like profile and email, and validate them before building a custom server and react app.

  • Add Scope Start Extraction and Validation6:27

    Add and validate scopes in an oauth flow by extracting token claims, decoding encoded segments, and mapping nested token data into a struct to verify scopes and audience.

  • Setup Audience Validation Part I14:38

    Learn to decode token claims, validate audiences and scopes, and set up audience validation in a GoLang React OAuth flow, including testing with sample scopes.

  • Finalize Keycloak Client Oauth Isomorphic Go App3:29

    Finalize the Keycloak client OAuth isomorphic Go app by validating audiences, wiring the utility functions, and testing the systems; plan to build a custom Go/Node/React implementation of the OAuth flow.

Requirements

  • Basic understanding of fullstack web development ( not 100% required )

Description

First we are going to explore setting up a Keycloak server. Second we will configure HTTPS via letsencrypt and Nginx to cancel our Certs. Next well create our own authentication server and resource server in both GoLang and Node. Last we will chop it all up and create a micro Authentication protocol specifically  for websockets.

Who this course is for:

  • Web Dev Hobbyists