Spring Web Security Configuration

Vue JS and Spring Boot Microservices and Spring Cloud User Service - (Spring Security Implementation)
9 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€60.11
List Price:  €85.87
You save:  €25.76
£52.07
List Price:  £74.39
You save:  £22.32
CA$96.72
List Price:  CA$138.18
You save:  CA$41.46
A$107.37
List Price:  A$153.39
You save:  A$46.02
S$90.24
List Price:  S$128.92
You save:  S$38.68
HK$545.84
List Price:  HK$779.80
You save:  HK$233.96
CHF 56.34
List Price:  CHF 80.49
You save:  CHF 24.15
NOK kr706.74
List Price:  NOK kr1,009.67
You save:  NOK kr302.93
DKK kr448.69
List Price:  DKK kr641.01
You save:  DKK kr192.32
NZ$119.45
List Price:  NZ$170.65
You save:  NZ$51.20
د.إ257.03
List Price:  د.إ367.21
You save:  د.إ110.17
৳8,511.37
List Price:  ৳12,159.63
You save:  ৳3,648.25
₹6,169.35
List Price:  ₹8,813.74
You save:  ₹2,644.38
RM295.88
List Price:  RM422.70
You save:  RM126.82
₦106,874.73
List Price:  ₦152,684.73
You save:  ₦45,810
₨19,719.68
List Price:  ₨28,172.18
You save:  ₨8,452.50
฿2,263.14
List Price:  ฿3,233.20
You save:  ฿970.05
₺2,881.58
List Price:  ₺4,116.73
You save:  ₺1,235.14
B$382.20
List Price:  B$546.03
You save:  B$163.82
R1,245.57
List Price:  R1,779.46
You save:  R533.89
Лв117.43
List Price:  Лв167.77
You save:  Лв50.33
₩97,558.65
List Price:  ₩139,375.48
You save:  ₩41,816.82
₪235.48
List Price:  ₪336.41
You save:  ₪100.93
₱3,998.15
List Price:  ₱5,711.89
You save:  ₱1,713.73
¥10,381.02
List Price:  ¥14,830.67
You save:  ¥4,449.64
MX$1,313.31
List Price:  MX$1,876.23
You save:  MX$562.92
QR254.80
List Price:  QR364.02
You save:  QR109.21
P939.68
List Price:  P1,342.46
You save:  P402.78
KSh9,042.70
List Price:  KSh12,918.70
You save:  KSh3,876
E£3,397.79
List Price:  E£4,854.20
You save:  E£1,456.40
ብር10,004.36
List Price:  ብር14,292.55
You save:  ብር4,288.19
Kz63,827.73
List Price:  Kz91,186.39
You save:  Kz27,358.65
CLP$67,779.01
List Price:  CLP$96,831.31
You save:  CLP$29,052.30
CN¥499.08
List Price:  CN¥713
You save:  CN¥213.92
RD$4,407.65
List Price:  RD$6,296.92
You save:  RD$1,889.26
DA9,093.02
List Price:  DA12,990.59
You save:  DA3,897.56
FJ$158.28
List Price:  FJ$226.12
You save:  FJ$67.84
Q536.13
List Price:  Q765.93
You save:  Q229.80
GY$14,622.96
List Price:  GY$20,890.84
You save:  GY$6,267.87
ISK kr8,633.26
List Price:  ISK kr12,333.76
You save:  ISK kr3,700.50
DH635.79
List Price:  DH908.31
You save:  DH272.52
L1,169.35
List Price:  L1,670.58
You save:  L501.22
ден3,693.98
List Price:  ден5,277.34
You save:  ден1,583.36
MOP$561.67
List Price:  MOP$802.43
You save:  MOP$240.75
N$1,232.98
List Price:  N$1,761.48
You save:  N$528.49
C$2,572.20
List Price:  C$3,674.73
You save:  C$1,102.52
रु9,857.19
List Price:  रु14,082.30
You save:  रु4,225.11
S/247.23
List Price:  S/353.21
You save:  S/105.97
K291.61
List Price:  K416.61
You save:  K124.99
SAR262.60
List Price:  SAR375.17
You save:  SAR112.56
ZK1,662.23
List Price:  ZK2,374.72
You save:  ZK712.48
L305.21
List Price:  L436.04
You save:  L130.82
Kč1,469.69
List Price:  Kč2,099.65
You save:  Kč629.95
Ft23,673.83
List Price:  Ft33,821.21
You save:  Ft10,147.37
SEK kr662.12
List Price:  SEK kr945.93
You save:  SEK kr283.80
ARS$95,260.79
List Price:  ARS$136,092.68
You save:  ARS$40,831.89
Bs482.98
List Price:  Bs690.01
You save:  Bs207.02
COP$280,278
List Price:  COP$400,414.31
You save:  COP$120,136.30
₡35,335.67
List Price:  ₡50,481.69
You save:  ₡15,146.02
L1,832.33
List Price:  L2,617.73
You save:  L785.40
₲504,830.94
List Price:  ₲721,217.97
You save:  ₲216,387.03
$U2,804.51
List Price:  $U4,006.62
You save:  $U1,202.10
zł255.72
List Price:  zł365.33
You save:  zł109.61
Already have an account? Log In

Transcript

Hi guys, in this lesson we will customize web security configuration. To do it. First of all, let's create a new package under our main package. Our package name VOB config. Under config package, we will create web security config class. To customize our security configuration, we will extend web security configure adapter in our class web security config, we'll have configuration and enable web security annotations With this configuration we will override configure methods.

In configure methods, we will use cross origin resource sharing because we will work with different ports. And we will authorize all the guests. If there is any match with these items like resources, error, and service permits all often. These means these items can be reached by everybody without authentication. You can think authentication as logging operation. For example, we can reach everything start with resources path.

You can ask me why we define error. We defined error bad because when you get errors on siblings But like not found error separate, we'll redirect to error path. So we should define error. But the other question can be why we permit user operations. User operations are like, login and register. So these paths should be reachable and public for everybody and authenticate all remaining URLs.

Log out, we look to user hours by invalidating the HTTP session, and logos pads VOB service logout and login paths will be service login and enable the basic authentication disable cross site request forgery. cross site request forgery is an important attic. So we will talk about later. That's all about configures methods. Our second methods will be defining user details service. You know that in previous lesson we customized user need a service.

So we will define In security configuration class to do it, we will override configure method. This configure method is for overriding the default authentication manager wielder. We can specify how the user details are kept in the application. It may be in a database LDAP or in memory. First of all, let's call user details service with sibling auto wired annotation. Then we can override authentication manager builders configure method our authentication user service, we The user details serves.

In security configuration, we can also define password encoder. sibling Caz B crypt passport encoder. And with this encoder, you can produce unique encrypted password for each time. After describing passport and Caribbean, we should define it in our authentication manager be a little configure method like a pending password encoder method. Okay, that's all about spring security configuration. As final theme, this class is a configuration class so we can define new bean or we can customise other sibling configurations.

We should define a lowering origins for cross origin resource sharing, so we can define it here also, we can do it with using that mec configuration class. Let's create a method like course configures. In this method, we will override add course mappings methods. We will ello all origins for testing and this matter will be a separate being You know, spring beam is creating new instances and default instances are Singleton. So this will be created one time and we can reach it through our application. Okay, that's all thank you.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.