455
Subscribers
No data24 hours
No data7 days
+230 days
Posts Archive
455
CREATE TABLE users (
user_id int(11) NOT NULL AUTO_INCREMENT,
username varchar(45) NOT NULL,
password varchar(64) NOT NULL,
role varchar(45) NOT NULL,
enabled tinyint(4) DEFAULT NULL,
PRIMARY KEY ('user_id')
);
INSERT INTO
users (username,password,role,enabled)
VALUES ('user',
'$2a$10$XptfskLsT1l/bRTLRiiCgejHqOpgXFreUnNUa35gJdCr2v2QbVFzu',
'ROLE_USER', 1);
INSERT INTO users (username,password,role,enabled)
VALUES ('emp',
'$2a$10$zxvEq8XzYEYtNjbkRsJEbukHeRx3XS6MDXHMu8cNuNsRfZJWwswDy',
'ROLE_EMP', 1);
INSERT INTO users (username,password,role,enabled)
VALUES ('admin',
'$2a$10$zxvEq8XzYEYtNjbkRsJEbukHeRx3XS6MDXHMu8cNuNsRfZJWwswDy',
'ROLE_ADMIN', 1);
INSERT INTO users (username,password,role,enabled)
VALUES ('mrg',
'$2a$10$zxvEq8XzYEYtNjbkRsJEbukHeRx3XS6MDXHMu8cNuNsRfZJWwswDy',
'ROLE_MGR', 1);455
import { useState } from "react";
const StateEx1=()=>{
const [str,setStr]=useState(
ReactJS);
const [num,setNum]=useState(100);
const [flag,setFlag]=useState(true);
const [arr,setArr]=useState([10,20,30,40,50]);
const [obj,setObj]=useState({"key1":"value1","key2":"value2","key3":"value3"});
const [products,setProducts]=useState([{"p_id":111,"p_name":"p_one","p_cost":10000},
{"p_id":222,"p_name":"p_two","p_cost":20000},
{"p_id":333,"p_name":"p_three","p_cost":30000}]);
return(
<>
<table border={1}
align="center"
cellPadding={10}
cellSpacing={10}>
<thead>
<tr>
<th>p_id</th>
<th>p_name</th>
<th>p_cost</th>
</tr>
</thead>
<tbody>
{
products.map((element,index)=>{
return(<tr key={index}>
<td>{element.p_id}</td>
<td>{element.p_name}</td>
<td>{element.p_cost}</td>
</tr>);
})
}
</tbody>
<tfoot></tfoot>
</table>
<h5>{obj.key1}...{obj.key2}...{obj.key3}</h5>
<hr></hr>
{
arr.map((element,index)=>{
return(<h5>{element}</h5>)
})
}
<hr></hr>
<h5>{JSON.stringify(flag)}</h5>
<hr></hr>
<h5>{num}</h5>
<hr></hr>
<h6>{str}</h6>
</>
)
}
export default StateEx1;455
1. AuthenticationFilter:
------------------------------
A filter that intercepts and performs authentication of a
particular request
by delegating it to authentication manager.
if authentication is successfull,
they authentication details set into Security context.
2. Authentication:
-------------------------
Using the supplied values from the user like user name
and password,
the authentication object will be for formed
which will be given as an input
to the authentication Manager interface.
3.Authentication Manager:
----------------------------------
Once received request from the filter it delegates
the validating of the user
details to the authentication provider.
4.authentication provider:
it has all the logic of validating user details
using UserDetailsService and PasswordEncoder.
UserDetailsService: UserDetailsService
retrievesUserDetails The user interface
using the supplied user name.
PasswordEncoder: Service interface form
encoding the password.
