Sunday, December 4, 2011

Check Authentication & Get Logged in user id

Use this code in you application module Impl class in methods

1) SecurityContext securityContext = ADFContext.getCurrent().getSecurityContext();
// 2. authentication check
if(securityContext.isAuthenticated()){
String username = securityContext.getUserName();

2) String userName = ADFContext.getCurrent().getSecurityContext().getUserName();
if(ADFContext.getCurrent().getSecurityContext().isAuthenticated()){