feature #32 Add LexikJWTAuthenticationBundle (chalasr)

This PR was merged into the master branch.

Discussion
----------

Add LexikJWTAuthenticationBundle

Alternative to https://github.com/symfony/recipes-contrib/pull/5, I think it would be more appropriated here as this bundle has no competitor regarding the need it solves.
Repository: https://github.com/lexik/LexikJWTAuthenticationBundle

Commits
-------

9fdecab Add LexikJWTAuthenticationBundle for JWT Authentication in Symfony
This commit is contained in:
Fabien Potencier
2017-05-01 16:26:05 -07:00
4 changed files with 26 additions and 0 deletions
@@ -0,0 +1,8 @@
generate-jwt-keys:
ifeq (, $(shell which openssl))
$(error "Unable to generate keys (needs OpenSSL)")
endif
mkdir -p etc/jwt
openssl genrsa -passout pass:${JWT_PASSPHRASE} -out ${JWT_PRIVATE_KEY_PATH} -aes256 4096
openssl rsa -passin pass:${JWT_PASSPHRASE} -pubout -in ${JWT_PRIVATE_KEY_PATH} -out ${JWT_PUBLIC_KEY_PATH}
@echo "\033[32mRSA key pair successfully generated\033[39m"
@@ -0,0 +1,4 @@
lexik_jwt_authentication:
private_key_path: "%env(JWT_PRIVATE_KEY_PATH)%"
public_key_path: "%env(JWT_PUBLIC_KEY_PATH)%"
pass_phrase: "%env(JWT_PASSPHRASE)%"
@@ -0,0 +1,13 @@
{
"bundles": {
"Lexik\\Bundle\\JWTAuthenticationBundle\\LexikJWTAuthenticationBundle": ["all"]
},
"copy-from-recipe": {
"etc/": "%ETC_DIR%"
},
"env": {
"JWT_PRIVATE_KEY_PATH": "%ETC_DIR%/jwt/private.pem",
"JWT_PUBLIC_KEY_PATH": "%ETC_DIR%/jwt/public.pem",
"JWT_PASSPHRASE": "%generate(secret)%"
}
}
@@ -0,0 +1 @@
<bg=blue;fg=white>Now</>, run <comment>make generate-jwt-keys</> to generate a key pair for LexikJWTAuthenticationBundle.