<commit_before>LexikJWTAuthenticationBundle
============================

[![Build Status](https://travis-ci.org/lexik/LexikJWTAuthenticationBundle.svg?branch=master)](https://travis-ci.org/lexik/LexikJWTAuthenticationBundle)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/67573b6f-e182-4394-b26a-649c323784f6/small.png)](https://insight.sensiolabs.com/projects/67573b6f-e182-4394-b26a-649c323784f6)

This bundle provides JWT (Json Web Token) services to authenticate users against your Symfony2 application using the great [namshi/jose](https://github.com/namshi/jose) library.

A typical use case for this would be a single page app (AngularJS, Ember.js, mobile app) using a Symfony2 API as backend.

Installation
------------

Installation with composer:

``` json
"require": {
    "lexik/jwt-authentication-bundle": "v1.0.0" // check packagist.org for more tags
}
```

Next, be sure to enable the bundle in your `app/AppKernel.php` file:

``` php
public function registerBundles()
{
    return array(
        // ...
        new Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle(),
        // ...
    );
}
```

Configuration
-------------

Please read the [namshi/jose library](https://github.com/namshi/jose) documentation first.

First, generate the keys used for token generation (for example) :

``` bash
$ openssl genrsa -out app/var/jwt/private.pem -aes256 4096
$ openssl rsa -pubout -in app/var/jwt/private.pem -out app/var/jwt/public.pem
```

Then in your `config.yml` :

``` yaml
lexik_jwt_authentication:
    private_key_path:   'app/var/jwt/private.pem'   # path to the private key
    public_key_path:    'app/var/jwt/public.pem'    # path to the public key
    pass_phrase:        ''                          # optional - pass phrase, defaults to ''
    token_ttl:          86400                       # optional - token ttl, defaults to 86400
```

Usage
-----

First of all, you need to authenticate the user using its credentials through form login.<commit_msg>Update keys path in README<commit_after>LexikJWTAuthenticationBundle
============================

[![Build Status](https://travis-ci.org/lexik/LexikJWTAuthenticationBundle.svg?branch=master)](https://travis-ci.org/lexik/LexikJWTAuthenticationBundle)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/67573b6f-e182-4394-b26a-649c323784f6/small.png)](https://insight.sensiolabs.com/projects/67573b6f-e182-4394-b26a-649c323784f6)

This bundle provides JWT (Json Web Token) services to authenticate users against your Symfony2 application using the great [namshi/jose](https://github.com/namshi/jose) library.

A typical use case for this would be a single page app (AngularJS, Ember.js, mobile app) using a Symfony2 API as backend.

Installation
------------

Installation with composer:

``` json
"require": {
    "lexik/jwt-authentication-bundle": "v1.0.0" // check packagist.org for more tags
}
```

Next, be sure to enable the bundle in your `app/AppKernel.php` file:

``` php
public function registerBundles()
{
    return array(
        // ...
        new Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle(),
        // ...
    );
}
```

Configuration
-------------

Please read the [namshi/jose library](https://github.com/namshi/jose) documentation first.

First, generate the keys used for token generation (for example) :

``` bash
$ openssl genrsa -out app/var/jwt/private.pem -aes256 4096
$ openssl rsa -pubout -in app/var/jwt/private.pem -out app/var/jwt/public.pem
```

Then in your `config.yml` :

``` yaml
lexik_jwt_authentication:
    private_key_path:   %kernel.root_dir%/var/jwt/private.pem   # path to the private key
    public_key_path:    %kernel.root_dir%/var/jwt/public.pem    # path to the public key
    pass_phrase:        ''                                      # optional - pass phrase, defaults to ''
    token_ttl:          86400                                   # optional - token ttl, defaults to 86400
```

Usage
-----

First of all, you need to authenticate the user using its credentials through form login.
{'fraction_non_alphanumeric': 0.13869149718206322, 'fraction_numerical': 0.035285469247733396, 'mean_word_length': 3.2300518134715026, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3449308', 'n_tokens_mistral': 1431, 'n_tokens_neox': 1299, 'n_words': 323}