5/4/2023 0 Comments Principle app tutorial![]() You can also get the user Principal object from other places in your code as long as you have access to a Securit圜ontextHolder object. String managersStatusCheck(Principal principal) Get Principal From the Security Context Holder Object Just add a Principalobject to your method as an argument and you will be able to access the Principal user details. Once you have Spring Security configured and working, here is how you can get the currently authenticated principal user object in the Controller class. Most likely you already have Spring Security configured for your Spring Boot application but if you do not have, here is a very short tutorial on how to configure Spring Security default username, password and a Role. There is more than one way to get currently authenticated user details and in this blog post, I am going to share with you a few. In this Spring Boot tutorial, you will learn how to get the details of the currently authenticated principal user.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |