<commit_before>How to configure this bundle?
=============================

## Without Encryption

```yml
lexik_jose:
    ttl: 3600                                     // The TTL of each token issued by the bundle
    server_name: 'https://my.super.service/'      // This value is used to verify the issuer/audience of the tokens
    key_set: '%env(LEXIK_JOSE_SIGNATURE_KEYSET)%' // The signature key set (loaded through an env variable)
    key_index: 0                                  // The index of the signature key in the key set
    signature_algorithm: "RS512"                  // The signature algorithm.
    claim_checked:                                // A list of additional claim checker aliases (optional).
        - 'my_claim_checker_alias'                // See https://web-token.spomky-labs.com for more information
```

For all signature algorithms available, please refer to the [spomky-labs/jose documentation](https://github.com/Spomky-Labs/jose#supported-signature-algorithms).

For key configuration, please refer to the [Random JWKSet documentation](https://github.com/Spomky-Labs/jose/blob/master/doc/object/jwkset.md#create-a-key-set-with-random-keys)

## With Encryption

```yml
lexik_jose:
    ...
    encryption:
        enabled: true                                  // We enable the encryption (highly recommended)
        key_set: '%env(LEXIK_JOSE_ENCRYPTION_KEYSET)%' // The encryption key set (loaded through an env variable)
        key_index: 0                                   // The index of the encryption key in the key set
        key_encryption_algorithm: '<KEY>'          // The key encryption algorithm
        content_encryption_algorithm: 'A256GCM'        // The content encryption algorithm
```

The `key_set` parameters must contain valid key sets as per the [RFC7517](https://tools.ietf.org/html/rfc7517).

**Note: we highly recommend you to enable the encryption support as the token may contain very sensitive information**

# Lexik JWT Authentication Bundle Configuration

Now you just have to set the `SpomkyLabs\LexikJoseBundle\Encoder\LexikJoseEncoder` as encoder service for the Lexik JWT Authentication Bundle:

```yml
lexik_jwt_authentication:
    encoder:
        service: "SpomkyLabs\LexikJoseBundle\Encoder\LexikJoseEncoder"
```

*Note: you can find [a complete example from our application configuration used for the tests](https://github.com/Spomky-Labs/lexik-jose-bridge/blob/v2.0/Tests/app/config/config.yml#L27-L40).*<commit_msg>Doc updated<commit_after>How to configure this bundle?
=============================

*Note: you can find [a complete example from our application configuration used for the tests](https://github.com/Spomky-Labs/lexik-jose-bridge/blob/v2.0/Tests/app/config/config.yml#L27-L40).*

## Without Encryption

```yml
lexik_jose:
    ttl: 3600                                     // The TTL of each token issued by the bundle
    server_name: 'https://my.super.service/'      // This value is used to verify the issuer/audience of the tokens
    key_set: '%env(LEXIK_JOSE_SIGNATURE_KEYSET)%' // The signature key set (loaded through an env variable)
    key_index: 0                                  // The index of the signature key in the key set
    signature_algorithm: "RS512"                  // The signature algorithm.
    claim_checked:                                // A list of additional claim checker aliases (optional).
        - 'my_claim_checker_alias'                // See https://web-token.spomky-labs.com for more information
```

For all signature algorithms available, please refer to the [spomky-labs/jose documentation](https://github.com/Spomky-Labs/jose#supported-signature-algorithms).

For key configuration, please refer to the [Random JWKSet documentation](https://github.com/Spomky-Labs/jose/blob/master/doc/object/jwkset.md#create-a-key-set-with-random-keys)

## With Encryption

```yml
lexik_jose:
    ...
    encryption:
        enabled: true                                  // We enable the encryption (highly recommended)
        key_set: '%env(LEXIK_JOSE_ENCRYPTION_KEYSET)%' // The encryption key set (loaded through an env variable)
        key_index: 0                                   // The index of the encryption key in the key set
        key_encryption_algorithm: 'A<KEY>'          // The key encryption algorithm
        content_encryption_algorithm: 'A256GCM'        // The content encryption algorithm
```

The `key_set` parameters must contain valid key sets as per the [RFC7517](https://tools.ietf.org/html/rfc7517).

**Note: we highly recommend you to enable the encryption support as the token may contain very sensitive information**
{'fraction_non_alphanumeric': 0.10192307692307692, 'fraction_numerical': 0.011111111111111112, 'mean_word_length': 2.662754303599374, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2860576', 'n_tokens_mistral': 1364, 'n_tokens_neox': 1282, 'n_words': 407}