Skip to content

Instantly share code, notes, and snippets.

@javiernuber
Created July 27, 2016 15:57
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 javiernuber/97a2de28b1d55e7b45f55135fe1bc58b to your computer and use it in GitHub Desktop.
Save javiernuber/97a2de28b1d55e7b45f55135fe1bc58b to your computer and use it in GitHub Desktop.
AtomicPosts - JWT - security
// source app/config/security.yml
security:
encoders:
AppBundle\Entity\User: bcrypt
providers:
api_provider:
entity:
class: AppBundle:User
firewalls:
api:
pattern: ^/api/
guard:
authenticators:
- app.jwt_token_authenticator
anonymous: true
access_control:
- { path: /api/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/api, roles: [ROLE_API] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment