Users management Portal using Spring-boot, React.js, Mysql | Spring-Security, JWT, Roles, Auth

  Рет қаралды 38,274

Phegon Dev

Phegon Dev

Күн бұрын

Пікірлер: 134
@mufabaa
@mufabaa 3 ай бұрын
thank you for this beautifully explained registry/login implementation!
@yogeshverma2638
@yogeshverma2638 5 ай бұрын
real good work easy to understand , source code , working project ; All in one . really helped me Thankyou.
@PhegonDev
@PhegonDev 5 ай бұрын
I'm glad it helped
@hash1345
@hash1345 5 ай бұрын
how you have run the project,plz help
@isaacnarteh8701
@isaacnarteh8701 3 ай бұрын
Thank you Phegon; you are phenomenal! Great Job! This is the most insightful video ever seen on KZbin. As a new developer, this video provided all that I need to know about authentication with JWT tokens and Spring security. I couldn't have followed anyone else to get a better understanding of these concepts. Keep doing the great work, brother!
@PhegonDev
@PhegonDev 3 ай бұрын
@@isaacnarteh8701 I've had it was helpful. Thanks for sharing Issac 🙏🙏
@marvinlewis4113
@marvinlewis4113 5 ай бұрын
You are a legend! I'm so grateful for your video. From the bottom of my heart, I would like to thank you.
@PhegonDev
@PhegonDev 5 ай бұрын
I appreciate
@marvinlewis4113
@marvinlewis4113 5 ай бұрын
​@@PhegonDev Very sorry to bother you, but how would you allow people to stay signed in even after they close the tab?
@kodiq3429
@kodiq3429 3 ай бұрын
the best video in whole youtube. It contains everything needed in 2,5h. Crazy work bro !
@PhegonDev
@PhegonDev 3 ай бұрын
@@kodiq3429 😁😁 Thanks Kodiq
@geniuspedia9508
@geniuspedia9508 4 ай бұрын
Thanks a lot for this wonderful video...
@PhegonDev
@PhegonDev 4 ай бұрын
@@geniuspedia9508 🙏🙏
@RyanTaio
@RyanTaio 7 ай бұрын
Amazing Tutorial for the backend. I haven't reached the frontend part yet but I'm sure it's going to be great as well. I was stuck on Spring Security JWT Authorization from 2 weeks and after watching this video I finally understand it. Thank you so much. Now I will be able to focus on some detailed projects.
@PhegonDev
@PhegonDev 7 ай бұрын
👍🏽👍🏽👍🏽👍🏽👍🏽👍🏽👍🏽👍🏽👍🏽👍🏽👍🏽👍🏽
@duongphan995
@duongphan995 5 ай бұрын
bro saved me, thank you so much
@PhegonDev
@PhegonDev 5 ай бұрын
I'm happy it helped
@nanayaw7159
@nanayaw7159 9 ай бұрын
Great UI
@PhegonDev
@PhegonDev 9 ай бұрын
Thanks friend
@suraphelojohannes5780
@suraphelojohannes5780 7 ай бұрын
I got Your video && my Problem get solved Thanks a lot.............. !
@PhegonDev
@PhegonDev 7 ай бұрын
I'm happy tw's helpful. Thanks for your comment 👍🏽
@nadetdevfullstack7041
@nadetdevfullstack7041 9 ай бұрын
Excellent
@PhegonDev
@PhegonDev 9 ай бұрын
Thanks man 🙏🏽
@naigjvdvjdjdbdb
@naigjvdvjdjdbdb 9 ай бұрын
Can u help me please
@MatheusCampos-xr5bv
@MatheusCampos-xr5bv 8 ай бұрын
very good video, u are awesome
@sbasalan
@sbasalan 2 ай бұрын
I would be very good choice to follow your video to build a clone of your work. Exciting 😀
@PhegonDev
@PhegonDev 2 ай бұрын
@@sbasalan that's exciting 😊😊 Thanks
@rahimullahhamidi4321
@rahimullahhamidi4321 8 ай бұрын
Very Good Video ❤❤❤❤❤❤❤
@ArchanSai
@ArchanSai 8 ай бұрын
how have you created the String secreteString = "84356...." ? @ TimeStamp - 25:23 in your video
@PhegonDev
@PhegonDev 8 ай бұрын
It's a random values. Just put in long random values
@isaacnarteh8701
@isaacnarteh8701 3 ай бұрын
You can randomly generate one for yourself using online java compiler. The java method to do that is below: import java.security.SecureRandom; public class TokenGenerator { private static final String CHARACTERS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; private static final int TOKEN_LENGTH = 100; // Adjust the length as needed public static void main(String[] args) { SecureRandom random = new SecureRandom(); StringBuilder token = new StringBuilder(TOKEN_LENGTH); for (int i = 0; i < TOKEN_LENGTH; i++) { int index = random.nextInt(CHARACTERS.length()); token.append(CHARACTERS.charAt(index)); } System.out.println(token.toString()); } }
@fatimaezzahrasafrani9469
@fatimaezzahrasafrani9469 5 ай бұрын
Why is the token sent in the register function?
@PhegonDev
@PhegonDev 5 ай бұрын
We only want admin to be able to register users. It's an User's Management Portal. We have admin who manages users. More like an enterise organization unboarding and managing her users
@Rida0921
@Rida0921 4 ай бұрын
I have online book store project where I want both user and admin to register themselves. What can bd done
@sbasalan
@sbasalan 2 ай бұрын
@@Rida0921 have you found a solution what you were looking for?
@thanhtam7219
@thanhtam7219 9 ай бұрын
I love u! It help me too much! ❤❤
@PhegonDev
@PhegonDev 9 ай бұрын
😃😃 I'm happy it helped. ❤
@ishratJahanEsha-b3g
@ishratJahanEsha-b3g 4 ай бұрын
code show a lot of error . to configuration in jwt
@moisesvillalba6615
@moisesvillalba6615 6 ай бұрын
Great Video!
@PhegonDev
@PhegonDev 5 ай бұрын
Thanks Moises
@lovekhanna009
@lovekhanna009 4 ай бұрын
Can you share same coruse me with angular as front
@PhegonDev
@PhegonDev 4 ай бұрын
Just skip to the frontemd part kzbin.info/www/bejne/fXXFd6qtp7l7jLs&t
@thenula__rathnayaka
@thenula__rathnayaka 2 күн бұрын
where is the sql part
@ShirleyG-gm7kv
@ShirleyG-gm7kv 5 ай бұрын
Which should be changed to allow everyone to register?
@PhegonDev
@PhegonDev 5 ай бұрын
For that, The permission role should be changes from ADMIN to USERS at the controller level
@omardaanoun255
@omardaanoun255 7 ай бұрын
Great tutorial! i want to know if there is any solution for the page refresh ??
@PhegonDev
@PhegonDev 7 ай бұрын
perform a navigation. That will trigger a refresh. E.g navigate ('/') or to any other page of choice navigate('/login ')
@rryann088
@rryann088 4 ай бұрын
how can we also store images pf user efficiently?
@PhegonDev
@PhegonDev 4 ай бұрын
You can store images on the cloud and save the link of that image in your database. Or store the image on a folder in your computer or server and save the path to that image on your database.
@RashidMd-ud4fj
@RashidMd-ud4fj 9 ай бұрын
❤good
@PhegonDev
@PhegonDev 9 ай бұрын
❤❤
@СайкалБатырбекова-в4у
@СайкалБатырбекова-в4у 8 ай бұрын
Hello! Thank you for helping students!)) I have a question: is it necessarily to test before creating FRONT-END?
@PhegonDev
@PhegonDev 8 ай бұрын
Yes it is. So you can detect and correct errors if present
@СайкалБатырбекова-в4у
@СайкалБатырбекова-в4у 8 ай бұрын
@@PhegonDev got it. thanks!!
@lauris5275
@lauris5275 3 ай бұрын
But if I generate random token with extra expiration date + with role admin I will have access to react admin routes no? Is there a way to prevent that from hapening. I dont want anyone to get inside admin panel.
@theBalancedByte
@theBalancedByte 16 күн бұрын
I think they can't. Not unless your jwt secret is exposed
@anilkumar-so5uf
@anilkumar-so5uf 5 ай бұрын
where to test the backend?
@PhegonDev
@PhegonDev 5 ай бұрын
I used postman
@jenishjustin7065
@jenishjustin7065 2 ай бұрын
how did you make postman where did it came from please expalain it
@PhegonDev
@PhegonDev 2 ай бұрын
download and install postman. It is used for api testing. www.postman.com/downloads/
@enocksigei
@enocksigei 6 ай бұрын
This is good though the accessToken and refreshToken are the same yet it is not supposed to be like that
@ankitaghadge.1337
@ankitaghadge.1337 5 ай бұрын
I didn't understand the code. Can u please give us an explanation?
@PhegonDev
@PhegonDev 5 ай бұрын
@@ankitaghadge.1337 I think you'll need a more beginner friendly course. You can look /search separately for spring boot , react course to get acquainted with the basics first
@ankitaghadge.1337
@ankitaghadge.1337 5 ай бұрын
@@PhegonDev i have basic understanding of spring boot and react js but I am not able to understand this spring security implementation
@ankitaghadge.1337
@ankitaghadge.1337 6 ай бұрын
There is no getter setter methods in Our user, I am getting so many error in UserManagementService file
@PhegonDev
@PhegonDev 6 ай бұрын
@Data from lombok helpd to auto generate getters and setters. You can use it
@ankitaghadge.1337
@ankitaghadge.1337 6 ай бұрын
Only login and register API is working rest all admin API are not working even though I have added correct token i got 403 status code
@ankitaghadge.1337
@ankitaghadge.1337 6 ай бұрын
I downloaded your projects backend zip file then added my database credentials and run the application then I tested in postman then only register and login API is working rest all API anmin/* nothing is working I got status code 403
@ankitaghadge.1337
@ankitaghadge.1337 6 ай бұрын
Is this because I am using Java 17?
@JamesEric-q4r
@JamesEric-q4r 8 ай бұрын
this is a very good videos especially the aspect of using jwt token for authorization and authentication but i have a question from the frontend aspect why should i have to reload the page whenever am logged in for my logout button to show and the same for the admin aspect for my profile,userManagement, login to show, is it expected to show authomatically whenever am logged in as a user or admin, in the sense of user friendly and then how can i register as an admin in the frontEnd, since the first thing i see when i open the page is a login page, what if am not registered as an admin then how can i register cause for me to login as an admin i must have been registered at the firstPlace cause you are using the registration from postman, please i need a feedback as soon as posible thank you.
@PhegonDev
@PhegonDev 8 ай бұрын
1, In your logout method. Have an implementation to navigate away from the page. This will trigger a component refresh. e.g navigate("/"). 2, For admin registration. You can create a separate component for admin registration. As you would not want the public to register as admin on your platform
@JamesEric-q4r
@JamesEric-q4r 8 ай бұрын
@@PhegonDev thanks it all makes sense now, i forgot using useNavigate from react-router-dom for navigation
@JamesEric-q4r
@JamesEric-q4r 8 ай бұрын
please a follow up question, can you make video of using jwt token for authentication or authorization without user role just authentication and authorization or do you have a video already for it
@titashipuserge3934
@titashipuserge3934 9 күн бұрын
bro why do you pass a bearer token during registration
@PhegonDev
@PhegonDev 9 күн бұрын
@@titashipuserge3934 we want admin to be able to register new users. It's more like an in-house app kind-off. You can modify to suit your use case. Once you understand the concept then cool
@titashipuserge3934
@titashipuserge3934 9 күн бұрын
Thank you very much. Now I understand better. That part really confused me. But I have another question: why was it working fine when you were creating normal users on Postman without passing a token?
@nithinkumarkodipaika
@nithinkumarkodipaika 9 ай бұрын
when I'am hitting /getallusers endpoint the jwt token is not validating in backend
@PhegonDev
@PhegonDev 9 ай бұрын
check your code again. And add multiple logs to see where the error is. It working fine if followed properly
@ManishKumarSahu-jd2ww
@ManishKumarSahu-jd2ww 8 ай бұрын
yess I am facing the same issue, were you able to solve the 403 forbidden for /get-all-users
@afrazch6446
@afrazch6446 7 ай бұрын
@@ManishKumarSahu-jd2ww do you find out how to resolve it?
@ApoorvaLavate
@ApoorvaLavate 7 ай бұрын
how did you fix it?
@hash1345
@hash1345 5 ай бұрын
plz share its database also
@PhegonDev
@PhegonDev 5 ай бұрын
like how?
@hash1345
@hash1345 5 ай бұрын
@@PhegonDev plz share sql code as well
@hash1345
@hash1345 5 ай бұрын
I am not able to run the code
@Afna.abubacker
@Afna.abubacker Ай бұрын
What is this secret string??? Can we give any ???
@PhegonDev
@PhegonDev Ай бұрын
@@Afna.abubacker Yes. You can give any long characters
@pankajthakur9760
@pankajthakur9760 8 ай бұрын
Hello Phegon dev Great tutorial i have setup it locally . i have issue after login / logout /add new user its not automatically refresh the page i have to relaod page manually?
@PhegonDev
@PhegonDev 8 ай бұрын
you can reinvoke the component to handle a refresh.
@Viki-v4p
@Viki-v4p 8 ай бұрын
Bro , I tried to push my spring project in github and it failed , because iam having some aws credentials like keys , bucket name , locations etc in application properties file ...What can i do to push my code?
@PhegonDev
@PhegonDev 8 ай бұрын
You should not push sensitive credentials to public repo, it's not a good practice. Ppl can use those credentials to access your account and disrupt your service. You should save them in an environment variable and refrence it when needed
@Viki-v4p
@Viki-v4p 8 ай бұрын
Can I use jasypt to encrypt the credentials???
@PhegonDev
@PhegonDev 8 ай бұрын
@@Viki-v4p sure you can.
@Viki-v4p
@Viki-v4p 8 ай бұрын
@@PhegonDev Thanks for the info bro❤️
@uricohavy5522
@uricohavy5522 6 ай бұрын
I'm getting a 401 unauthorized error when trying to register a new user in Postman. Any ideas what's causing this and how to fix?
@PhegonDev
@PhegonDev 6 ай бұрын
add more logs to your service to see which code is breaking. You shouldn't be passing in an auth token when logging it, but if you are, make sure it is not expired
@GamingMaharajaHDS
@GamingMaharajaHDS 4 ай бұрын
can i use java17 for same code
@PhegonDev
@PhegonDev 4 ай бұрын
sure you can
@whanderlust03
@whanderlust03 9 ай бұрын
hello, i tired following your video but ive encountered an http 403 error right after i started my spring app. i have csrf disabled just like in the video, do you pls have any suggestions on how to fix this problem?
@PhegonDev
@PhegonDev 9 ай бұрын
I can't see what you doing on your code. But if you follow it correctly, it'll work, as it's woking for others.
@ManishKumarSahu-jd2ww
@ManishKumarSahu-jd2ww 8 ай бұрын
hey, were you able to overcome this 403 error, I am facing the same issue
@ManishKumarSahu-jd2ww
@ManishKumarSahu-jd2ww 8 ай бұрын
make "Authorization" as "Authorization " in the JWTAuthFilter
@sriramrajkumar2774
@sriramrajkumar2774 5 ай бұрын
@@ManishKumarSahu-jd2ww I cant understand
@LewiWanjohi
@LewiWanjohi 6 ай бұрын
I'm getting a 404 unauthorized error when trying to register a new user in Postman. Any ideas what's causing this and how to fix?
@PhegonDev
@PhegonDev 6 ай бұрын
Add multiple logs to different steps in your service so you can see which code(method) is failing. By doing so, you'll know where the error is coming from
@chirukurisushma5530
@chirukurisushma5530 4 ай бұрын
In Github frontend there is app.css code please provide
@PhegonDev
@PhegonDev 4 ай бұрын
the css code not usefull
@NimmagaddaHarikiran
@NimmagaddaHarikiran 5 ай бұрын
why are settind the is accountnotexpired and is password not expiredtrue in the ouruser class
@PhegonDev
@PhegonDev 5 ай бұрын
By default they are expired it is our duty to set and say they are not expired. Else authentication will fail
@pubudunichanikawijesinghe4932
@pubudunichanikawijesinghe4932 4 ай бұрын
Thank u very much for sharing ur knowledge.
@PhegonDev
@PhegonDev 4 ай бұрын
Thanks. That a great observation and suggestion. You can call the api path "admin/register". As long we have the admin guard, we are good. That's a great one 👍🏽👍🏽👍🏽
@xiaoming6958
@xiaoming6958 9 ай бұрын
Please show about refresh token in react js
@Viki-v4p
@Viki-v4p 9 ай бұрын
Bro the way that you are handling the exception , can i do it for my companies projects..Is it valid or else i should handle it separately using Exception classes.
@PhegonDev
@PhegonDev 9 ай бұрын
Use a Custom Exception Class
@Viki-v4p
@Viki-v4p 9 ай бұрын
@@PhegonDev Can you make the video for exception handling like how it actually to be.
@Viki-v4p
@Viki-v4p 9 ай бұрын
Bro ,is Learning spring boot worth? Because whatever content iam searching about spring boot in a websites are too old content and also most of them deprecated ..And I cant find my solutions in both youtube and websites?
@PhegonDev
@PhegonDev 9 ай бұрын
It depends; 1. Are you already working in a company where java is required? If yes, then Spring Boot is worth it. 2. Do you have a strong background in Java? If yes, spring boot is worth it .There are java jobs and those companies most likely are using spring boot. 3. If your primary focus is in python or node or you are working for a company that majors in python or node, then spring-boot isn't worth it. Instead, you can focus on the technology for those languages. 4. If you are relatively new to programming, I’ll suggest you shouldn’t focus solely on spring boot. You should rather give more priority to python. As Python is popular in developing AI models, ML, Quantum computing and more.
@Viki-v4p
@Viki-v4p 9 ай бұрын
@@PhegonDevokay ..Thanks for that kind info.
@dcm6267
@dcm6267 7 ай бұрын
Good video. But there's a small problem, I have to manually refresh. Any solution?
@PhegonDev
@PhegonDev 7 ай бұрын
Trigger a change in component state. That can be done by several ways e.g by navigating. navigate ("/").
@dcm6267
@dcm6267 7 ай бұрын
@@PhegonDev Thank you. I used " window.location.reload() ". Sucess.
@zhaolunzhang8831
@zhaolunzhang8831 7 ай бұрын
Can I ask one question, when I click the frontend at the user management, it shows the error"Cannot read properties of undefined (reading 'map')". Do you know how to fix it? Can I send your email? Thank you.
@zhaolunzhang8831
@zhaolunzhang8831 7 ай бұрын
Ok, I solved it. Thank you.
@PhegonDev
@PhegonDev 7 ай бұрын
@@zhaolunzhang8831 nice 🙂
@bakiriwalid7409
@bakiriwalid7409 7 ай бұрын
this is by far ..the best video ever im jst facing error {statusCode: 500, message: 'No value present'} when i try to login can any one help on it thanks
@PhegonDev
@PhegonDev 7 ай бұрын
Cross check if the login credentials exist in the database. You can add logging to different steps and methods when trying to perform a login. That will determine which method the error is coming from, although I didn't do this on the tutorial but they'll help to know which method is failing
@bakiriwalid7409
@bakiriwalid7409 7 ай бұрын
Thanks so much ..i geg it fix was username mismatch ..was my mistake..thanks so much was best tuto ever
@dcm6267
@dcm6267 7 ай бұрын
@@bakiriwalid7409 ​ how did you fix it? same issue on me. {statusCode: 500, message: 'Bad credentials'} message : "Bad credentials" statusCode : 500 [[Prototype]] : Object constructor : ƒ Object() hasOwnProperty : ƒ hasOwnProperty() isPrototypeOf : ƒ isPrototypeOf() propertyIsEnumerable : ƒ propertyIsEnumerable() toLocaleString : ƒ toLocaleString() toString : ƒ toString() valueOf : ƒ valueOf() __defineGetter__ : ƒ __defineGetter__() __defineSetter__ : ƒ __defineSetter__() __lookupGetter__ : ƒ __lookupGetter__() __lookupSetter__ : ƒ __lookupSetter__() __proto__ : (...) get __proto__ : ƒ __proto__() set __proto__ : ƒ __proto__()
@irinaoltean5010
@irinaoltean5010 8 ай бұрын
Great tutorial! But I am now struggling with implementing session management further. Any ideas on how to add that?
@ponirmahmud5017
@ponirmahmud5017 6 ай бұрын
need to improve the voice. Demonstration is good.
@PhegonDev
@PhegonDev 6 ай бұрын
noted
Spring Boot + Spring Security + JWT from scratch - Java Brains
39:29
Война Семей - ВСЕ СЕРИИ, 1 сезон (серии 1-20)
7:40:31
Семейные Сериалы
Рет қаралды 1,6 МЛН
Use Jwt and the Roles to Secure Your Fullstack ReactJS and Spring Boot / Spring Security
10:42
How principled coders outperform the competition
11:11
Coderized
Рет қаралды 1,8 МЛН
one year of studying (it was a mistake)
12:51
Jeffrey Codes
Рет қаралды 270 М.
This is Why Programming Is Hard For you
10:48
The Coding Sloth
Рет қаралды 1 МЛН
Война Семей - ВСЕ СЕРИИ, 1 сезон (серии 1-20)
7:40:31
Семейные Сериалы
Рет қаралды 1,6 МЛН