You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Documenting the Authentication Mechanism with Swagger/Open API
64
64
65
-
You want to test the routes of your API protected by JWTauthentication?
65
+
Want to test the routes of your JWT-authentication-protected API?
66
66
67
67
### Configuring API Platform
68
68
@@ -74,14 +74,14 @@ api_platform:
74
74
- { name: 'Authorization', type: 'header' }
75
75
```
76
76
77
-
And the Authorize button will automatically appear in Swagger UI.
77
+
And the "Authorize" button will automatically appear in Swagger UI.
78
78
79
79

80
80
81
81
### Adding a New API Key
82
82
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).
85
85
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.
86
86
87
87
```
@@ -93,7 +93,7 @@ Bearer MY_NEW_TOKEN
93
93
94
94
## Testing with Behat
95
95
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:
97
97
98
98
```php
99
99
<?php
@@ -106,7 +106,7 @@ use Behatch\Context\RestContext;
106
106
class FeatureContext implements Context, SnippetAcceptingContext
107
107
{
108
108
// ...
109
-
// Must be aster createDatabase() and dropDatabase() functions (the order matters)
109
+
// Must be after createDatabase() and dropDatabase() functions (the order matters)
110
110
111
111
/**
112
112
* @BeforeScenario
@@ -156,4 +156,4 @@ default:
156
156
# ...
157
157
```
158
158
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.
0 commit comments