Hi,

Take a look at Shiro’s SpringBoot 3 example.
This should get your started: 
https://github.com/apache/shiro/blob/main/samples/spring-boot-3-web/src/main/java/org/apache/shiro/samples/HelloController.java
 
<https://github.com/apache/shiro/blob/main/samples/spring-boot-3-web/src/main/java/org/apache/shiro/samples/HelloController.java>

Let us know if you have any further questions.

> On Apr 13, 2024, at 10:29 AM, Helge Wiemann <h...@feedbager.de> wrote:
> 
> Hi all,
> 
> I am quite new to Shiro and currently moving from Spring Security to Shiro.
> 
> 
> One question: After a user is successfully authenticated and authorized, what 
> is the best way to get the user in a Spring controller method?
> 
> With used Spring Security it was something like that:
> 
> publicModelAndView 
> index(*@AuthenticationPrincipalUsernamePasswordAuthenticationTokenauthenticatedUser*,
> 
> HttpServletRequest request, HttpServletResponse response) throwsIOException {
> 
> 
> Best regards,
> 
> 
> Helge
> 

Reply via email to