public static App getAuthenticatedApp() {
		App app = null;
		if (SecurityContextHolder.getContext().getAuthentication() != null) {
			Authentication auth = SecurityContextHolder.getContext().getAuthentication();
			if (auth.isAuthenticated() && auth.getPrincipal() instanceof App) {
				app = (App) auth.getPrincipal();
			}
		}
		return app;
	}
public static App getAuthenticatedApp ( ) { App app = null ; if ( SecurityContextHolder . getContext ( ) . getAuthentication ( ) != null ) { Authentication auth = SecurityContextHolder . getContext ( ) . getAuthentication ( ) ; if ( auth . isAuthenticated ( ) && auth . getPrincipal ( ) instanceof App ) { app = ( App ) auth . getPrincipal ( ) ; } } return app ; }
Extracts a App object from the security context.
@return an authenticated app or null if a app is not authenticated