Skip to content

Instantly share code, notes, and snippets.

@marcoleong
Created March 5, 2012 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcoleong/1979204 to your computer and use it in GitHub Desktop.
Save marcoleong/1979204 to your computer and use it in GitHub Desktop.
symfony2 authentication user, use this in controller
//...
if(!$this->get('security.context')->isGranted('IS_AUTHENTICATED_FULLY')){
throw new AccessDeniedException();
}
//...
$user = $this->get('security.context')->getToken()->getUser();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment