stefv
stefv

Reputation: 439

How to use Spring Security OAuth2 with Apache Wicket?

I would like to use an OAuth2 authentication with my Apache Wicket website.

My website is using Spring Boot and Spring Security for the authentication part, but I would like to use the @AuthorizeInstantiation Wicket annotation to protect the pages.

Can I use these frameworks together and how ?

Thank you.

Upvotes: 0

Views: 435

Answers (1)

martin-g
martin-g

Reputation: 17513

Sure, you can combine them!

See wicket-auth-roles module for inspiration how to implement authentication in Wicket. The difference with Spring Security is that you need to use SecurityContextHolder.getContext().getAuthentication() to get the currently logged in user/principal.

If you decide to extend from AbstractAuthenticatedWebSession then its public abstract boolean isSignedIn(); should use Spring Security APIs to get the Principal.

Upvotes: 1

Related Questions