Skip to content

Commit 20b53cd

Browse files
greg0iredunglas
authored andcommitted
Proofread jwt (#334)
1 parent 09def56 commit 20b53cd

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

core/jwt.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ security:
5858
- { path: ^/login, role: IS_AUTHENTICATED_ANONYMOUSLY }
5959
- { path: ^/books, roles: [ ROLE_READER ] }
6060
- { path: ^/, roles: [ ROLE_READER ] }
61-
```
61+
```
6262
6363
## Documenting the Authentication Mechanism with Swagger/Open API
6464
65-
You want to test the routes of your API protected by JWT authentication?
65+
Want to test the routes of your JWT-authentication-protected API?
6666
6767
### Configuring API Platform
6868
@@ -74,14 +74,14 @@ api_platform:
7474
- { name: 'Authorization', type: 'header' }
7575
```
7676
77-
And the Authorize button will automatically appear in Swagger UI.
77+
And the "Authorize" button will automatically appear in Swagger UI.
7878
7979
![Screenshot of API Platform with Authorize button](images/JWTAuthorizeButton.png)
8080
8181
### Adding a New API Key
8282
83-
All you have to do is to configure the API key in the value field.
84-
By default [only the authorization header mode is enabled](https://github.com/lexik/LexikJWTAuthenticationBundle/blob/master/Resources/doc/index.md#2-use-the-token) in [LexikJWTAuthenticationBundle](https://github.com/lexik/LexikJWTAuthenticationBundle).
83+
All you have to do is configuring the API key in the `value` field.
84+
By default, [only the authorization header mode is enabled](https://github.com/lexik/LexikJWTAuthenticationBundle/blob/master/Resources/doc/index.md#2-use-the-token) in [LexikJWTAuthenticationBundle](https://github.com/lexik/LexikJWTAuthenticationBundle).
8585
You must set the [JWT token](https://github.com/lexik/LexikJWTAuthenticationBundle/blob/master/Resources/doc/index.md#1-obtain-the-token) as below and click on the "Authorize" button.
8686

8787
```
@@ -93,7 +93,7 @@ Bearer MY_NEW_TOKEN
9393
9494
## Testing with Behat
9595
96-
Let's configure Behat to automatically send a `Authorization` HTTP header containing a valid JWT token when a scenario is marked with a `@login` annotation. Edit `features/bootstrap/FeatureContext.php` and add the following methods:
96+
Let's configure Behat to automatically send an `Authorization` HTTP header containing a valid JWT token when a scenario is marked with a `@login` annotation. Edit `features/bootstrap/FeatureContext.php` and add the following methods:
9797
9898
```php
9999
<?php
@@ -106,7 +106,7 @@ use Behatch\Context\RestContext;
106106
class FeatureContext implements Context, SnippetAcceptingContext
107107
{
108108
// ...
109-
// Must be aster createDatabase() and dropDatabase() functions (the order matters)
109+
// Must be after createDatabase() and dropDatabase() functions (the order matters)
110110
111111
/**
112112
* @BeforeScenario
@@ -156,7 +156,7 @@ default:
156156
# ...
157157
```
158158

159-
Finally, mark your scenarios with the `@login` annotation to automatically add a valid `Authorization` header and with `@logout` to be sure to detroy the token after this scerario.
159+
Finally, mark your scenarios with the `@login` annotation to automatically add a valid `Authorization` header, and with `@logout` to be sure to destroy the token after this scenario.
160160

161161
Previous chapter: [FOSUserBundle Integration](fosuser-bundle.md)
162162

0 commit comments

Comments
 (0)