Mô tả

This video course is for beginner Java developers who are interested in learning how to secure OAuth 2.0 Resources in Spring Security 5.

The course covers only the new OAuth 2.0 stack in Spring Security 5.

You will learn how to: 

  • Perform each OAuth 2 authorization flow,

    • Authorization Code,

    • PKCE-enhanced authorization code,

    • Client credentials,

    • Password credentials.

  • Startup and configure the Keycloak server,

  • Configure OAuth 2 Resource Server,

  • Startup multiple Resource Servers on random port numbers,

  • Configure Spring Cloud API Gateway,

  • Configure and use Eureka Registry and Discovery Service,

  • Build a simple Spring MVC Web Application that fetches data from a protected Resource Server running behind Spring Cloud API Gateway.

  • Implement a simple JavaScript application that uses PKCE-Enhanced authorization code to acquire JWT access tokens and communicate with protected Resource Server,

  • Learn how to refresh an expired JWT Access token,

  • Learn to implement Scope-base access control,

  • Learn how to implement Role-based access control,

  • OAuth social login with Facebook, Google, and Okta accounts,

  • Implement Keycloak Remote User Authentication(User Storage SPI)

  • New Spring Authorization Server version 0.2.2

This is a step-by-step video course that explains how to use OAuth 2 from the very beginning. If you do not have experience with OAuth and would like to learn how to use it in Spring Boot Web Applications, then this video course is for you.

Bạn sẽ học được gì

OAuth 2.0

OAuth 2 Authorization Flows

The New OAuth 2.0 stack in Spring Security 5

Use OAuth 2.0 in Spring Boot Applications

Configure OAuth 2.0 Resource Server

Keycloak Identity and Access Management Solution

Resource Servers behind API Gateway

New Spring Authorization Server

OAuth 2.0 in MVC Web App

OAuth 2 - Social Login

OAuth2 + PKCE in JavaScript Application

Register Resource Servers with Eureka Service Registry

Yêu cầu

  • Knowledge of Java
  • Knowledge of Spring Boot
  • Knowledge of Spring MVC

Nội dung khoá học

20 sections

Introduction

9 lectures
Source Code
01:22
Presentation files
00:11
Introduction
04:24
Introduction to OAuth 2
07:19
OAuth 2.0 Roles
03:16
Current State of OAuth 2.0 in Spring Security 5
04:18
OAuth 2.0 Client Types
05:00
OAuth Access Token
07:45
OAuth2 and OpenID Connect (OIDC)
03:39

OAuth 2 Grant Types and Authorization Flows

14 lectures
Introduction
04:26
Authorization Code. Introduction.
09:45
Authorization Code Demo. Initial Request.
07:36
Important note
00:09
Authorization Code Demo. Exchange code for Access token.
04:21
PKCE-enhanced Authorization Code
05:37
Generating PKCE Code Verifier
01:13
Generating PKCE Code Challenge
01:29
PKCE Demo. Requesting Authorization Code
07:20
PKCE Demo. Exchanging Code for Access Token
04:43
Client Credentials
01:41
Client Credentials Grant Type Demo
02:37
The Password Credentials Flow
02:13
The Password Credentials Flow: Demo
03:01

Refreshing Access Token

3 lectures
Introduction
05:04
Requesting Refresh Token that never expires
02:25
Refreshing Access Token. Demonstration.
03:13

Keycloak. The Standalone Authorization Server.

11 lectures
Introduction
04:07
[Updated] Downloading Standalone Authorization Server Keycloak
01:54
[Updated] Starting and Stopping Keycloak server
03:58
[Updated] Creating an Admin user
01:22
[Updated] Creating a new Realm
03:03
[Updated] Creating a new user
03:44
[Updated] Creating a new OAuth Client
08:40
[Updated] Configuring Client Application Secrets
01:38
[Updated] Requesting Access Token and Refresh Token
05:19
[Updated] Enable/Disable OAuth 2.0 Authorization Flow
03:49
[Updated] OAuth 2.0 Client Scopes
06:04

OAuth Resource Server

9 lectures
Introduction
03:00
Creating a new project
04:04
Import project into Spring Tool Suite IDE
00:56
Starting Resource Server on different port number
01:35
Creating a Rest Controller Class
04:49
Access Token Validation URIs
02:57
Accessing endpoints with an Access Token
03:52
Accessing Principal and JWT Claims
04:16
Demo - Accessing JWT Claims
03:37

Resource Server - Scope Based Access Control

7 lectures
Introduction
09:14
[Updated] Create WebSecurity class and enable WebSecurity
04:10
[Updated] Configure basic HttpSecurity in Resource Server
03:45
[Updated] Resource Server OAuth Scope-based Access Control
02:36
Demo - Access Resource Server without using proper Scope
03:13
Demo - Access Resource Server using proper Scope
01:05
Creating OAuth 2 Scope in Keycloak
00:14

Role Based Access Control with Keycloak

9 lectures
Introduction
05:34
Source code
00:08
Creating User Role
01:14
Securing Endpoints to a Specific Role
02:23
Creating Role Converter class
02:08
Decoding JWT to find user roles
02:11
Converting Roles into GrantedAuthority objects
01:31
Register JwtAuthenticationConverter with HttpSecurity
01:07
Trying how it works
03:39

Resource Server: Method Level Security

10 lectures
Introduction
04:55
Source code
00:08
Enable Method Level Security
02:19
@Secured annotation example
05:54
@PreAuthorized annotation
03:59
Reading UserId from JWT Access Token
05:38
Trying how the @PreAuthorized annotation works
03:00
Creating getUser() to be used with @PostAuthorize
03:30
@PostAuthorized annotation
03:08
Trying how to the @PostAuthorized annotation works
04:06

Resource Server Behind API Gateway

8 lectures
Introduction
06:01
Creating API Gateway Project
04:17
Import API Gateway to Spring Tool Suite
00:36
Configuring API Gateway Routes
06:26
Trying how it works
03:45
Albums & Photos Resource Servers
03:44
Routing to multiple Resource Servers
03:04
Trying how it works
04:09

Eureka Discovery Service

3 lectures
Introduction
04:39
Creating Eureka Discovery Service Project
03:23
Configuring Eureka project
03:49

Configure Resource Server as Eureka Client

6 lectures
Eureka Client Dependency
04:12
@EnableDiscoveryClient and configuration properties
02:45
Trying how it works
00:50
Exercise
01:09
Source Code
00:17
Solution overview
04:46

Load Balancing

7 lectures
Load Balancing - Introduction
02:07
Starting Resource Servers on Random IP Address
04:12
Eureka and Resource Server Instance Id
07:00
Configuring API Gateway as Eureka Client
04:37
Configure API Gateway Routes
03:24
Return the running port number
02:16
Trying how it works
03:46

OAuth 2.0 in MVC Web App

18 lectures
OAuth 2.0 in MVC Web App - Introduction
01:42
Source code
00:05
Creating a new Spring Boot Project
02:28
Creating Controller class
04:12
Returning list of albums
04:54
Displaying Albums in HTML Page
04:21
Adding OAuth2 Client Dependency
01:19
Configuring OAuth2 Client properties
05:30
Configuring OAuth2 Provider properties
02:39
Reading ID Token
06:25
Reading JWT Access Token
06:11
HTTP Request to an Internal Resource Server
07:38
Trying how it works
02:08
A different approach to adding access token
01:27
Adding WebClient Dependency
01:15
Creating a WebClient Bean
04:52
Using WebClient in a Controller class
02:40
Trying how it works
01:41

OAuth 2 - Social Login

21 lectures
Introduction
01:54
Source code
00:09
Creating a new project
02:15
Protected Resource Controller class
04:03
Protected Resource HTML Page
03:04
Creating public page
03:09
Configure HTTP Security
03:04
OAuth 2 Client and Provider configurations
04:53
Facebook: Client Id and Client Secret
02:06
Trying how Facebook login works
01:30
Google Client Id and Client Secret
07:44
Trying how Google sign-in works
01:05
Register a new Okta app
03:49
Configure Okta properties
03:40
Trying how sign-in with Okta works
00:59
Configure logout functionality
03:43
Configure the Logout link
01:12
Trying how logout link works
02:44
OpenID Connect End Session Endpoint
03:51
Implementing OidcClientInitiatedLogoutSuccessHandler
02:55
Trying how Logout from Okta works
01:07

OAuth2 + PKCE in JavaScript Application

17 lectures
Introduction
02:08
Creating a new Public client in Keycloak
05:32
Creating a new Spring Boot client application
01:25
Creating Index.html
01:45
Import jQuery
01:08
Generating Random State value
04:11
Generating Code Verifier value
02:28
Generating Code Challenge value
03:26
Requesting PKCE-Enhanced Authorization Code
05:10
Creating Auth Code Reader HTML Page
00:59
Reading authorization code from the Redirect URI
03:42
Validating "state" request parameter
02:16
Exchange Code for Access Token
05:45
Finding Refresh Token and ID Token
02:10
Sending Request to Resource Server
05:21
Configure CORS Access on API Gateway
04:53
Configure CORS in Resource Server
10:04

Keycloak Remote User Authentication. User Storage SPI.

17 lectures
Introduction
04:04
Creating a new project
03:09
Creating RemoteUserStorageProvider class
04:46
Creating RemoteUserStorageProviderFactory class
04:03
Adding Keycloak Core Dependency
01:25
Solution overview
03:27
Remote Users Webservice Overview
09:15
RESTEasy HTTP Client Dependency
01:43
Implementing Users Api Service
05:54
Creating User Class
03:05
Adding the verifyUserPassword to UsersApiService
03:56
Building RESTEasy HTTP Client
04:45
Implementing getUserByUsername() method
05:38
Verifying User Password
03:47
Packaging UserStorageProvider
04:16
Deploying User Storage SPI
08:44
Trying how it works
04:41

The New Spring Authorization Server

8 lectures
Introduction
03:32
Source code. Spring Authorization Server . Updated to Spring Boot 3.
00:08
Creating Spring Authorization Server project
04:01
Register an OAuth Client
08:44
Configure Spring Authorization Server
05:30
Spring Security Configuration
03:38
A request for Authorization Code
04:58
Exchange Authorization Code for JWT Access Token
06:06

Resource Server for Spring Authorization Server

4 lectures
Creating and Configuring Spring Resource Server
03:51
Resource Server API Endpoint
04:18
Consume protected API Endpoints
03:38
Making Request Stateless
00:27

OAuth Client App for New Spring Authorization Server

6 lectures
Introduction
00:30
Project Overview
03:40
OAuth2 Client-related configuration
04:41
Reading the JWT Access Token
02:52
Sending HTTP Request
03:43
Trying how it works
01:38

What's next?

1 lectures
Bonus
02:17

Đánh giá của học viên

Chưa có đánh giá
Course Rating
5
0%
4
0%
3
0%
2
0%
1
0%

Bình luận khách hàng

Viết Bình Luận

Bạn đánh giá khoá học này thế nào?

image

Đăng ký get khoá học Udemy - Unica - Gitiho giá chỉ 50k!

Get khoá học giá rẻ ngay trước khi bị fix.