WAM and the Java Stack
Disclaimer This is a training NOT a presentation. – Be prepared to learn and participate in labs Please ask questions Prerequisites: – Basic Java knowledge – Basic Spring knowledge – LDS Account Integration Training – Part 1
Outline Spring Security and Authorization WAM (Web Access Management) WAM integration w/o Spring Security WAM integration w/ Spring Security
Review Authentication vs. Authorization Previously discussed authentication with Spring Security Now focus on authorization with Spring Security
Authorization with Spring Security security/site/features.html – Comprehensive Authorization Services HTTP requests authorization (securing annotation
Protecting Urls Example of protecting urls
???? Fine grained authorization Content only visible to users who have the “chicken" authority in their list of GrantedAuthority(s). Content only visible to users authorized to send requests to the "/chicken" URL.
@PreAuthorize annotation Scanning enabled with following element: Some public void create(User == authentication.username") public void doSomething(User user);
Authorities Populators sites/stack/module.html?module=lds- account/stack-lds-account- spring/index.html#Authorities_Populators Example TODO: show example of specifying on a authentication element
Demo
WAM (Web Access Management)
What is WAM? WAM stands for Web Access Management Authentication – Authentication management – Single Sign-on Authorization – Url (course-grained) – Entitlements (fine-grained)
Architectural Overview of WAM
Injected Headers WAM injected headers: – How the headers map with LDS Account (LDAP) attributes: – tation%20Details/HTTP%20Headers.aspx Required headers – policy-ldsaccountid – policy-cn
Wamulator For complete documentation: – WAM Maven plugin provided to start/stop the wamulator
Demo
Stack / WAM integration w/o Spring Security code.lds.org/maven- sites/stack/module.html?module=lds- account/stack-lds-account- wam/index.html#Configuration wamContextFilter org.lds.stack.wam.filter.WamContextFilter wamContextFilter /*
WamContext Accessed with: WamContexts consists of 3 main parts: – LdsAccountDetails object – WamRequestProvider – EntitlementService WamContextHolder.getWamContext(); WamContextHolder.getWamContext().getLdsAccountDetails().getPreferredName(); WamContextHolder.getWamContext().getWamRequestProvider ().getCookieHeader(); WamContextHolder.getWamContext().getEntitlementService()….
Demo
Lab 1 _Part_1#Lab_1
WAM and Spring Security
Why WAM and Spring Security? Spring Security provides – Full featured authorization system – Abstraction to authentication and authorization – Allows for complex fallback authentication systems – Facilitates proxy support
WAM Spring Security Integration Integration point <intercept url TODO …
Demo
Spring Security and WAM authorization Spring provides programming tools – Full featured EL capabilities – Convenient annotations – Management central to the application
Spring Security EntryPoint Simplifies WAM configuration / management Utilizes WAM for authentication – User details injected if authenticated Allows course grained authorization to be managed within the application
Spring Integration
Demo
Lab 2 _Part_1#Lab_2
Conclusion LDS Account rocks! The Java Stack integration with LDS Account and Spring Security rocks!
Credit Where Credit is Due security/site/docs/3.1.x/reference/springsecurity -single.html Spring Security 3 – by Peter Mularien