Skip to content

Commit 8db01bc

Browse files
committed
updated references to authentication
Signed-off-by: bidi47 <bidi@apidemia.com>
1 parent e7741a0 commit 8db01bc

5 files changed

Lines changed: 11 additions & 10 deletions

File tree

‎docs/book/v7/core-features/authentication.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This allows users to exchange their credentials (username/password) for access t
2424
These tokens are then used for later requests instead of repeatedly sending credentials.
2525

2626
Authentication in Dotkernel API is built around the `mezzio/mezzio-authentication-oauth2` component and is already configured out of the box.
27-
To customize authentication behavior (token lifetimes, algorithms, etc.), edit `config/autoload/local.php` under the `authentication` key.
27+
To customize authentication behavior (token lifetimes, algorithms, etc.), edit `config/autoload/authentication.global.php` under the `authentication` key.
2828
See the [Mezzio OAuth2 documentation](https://docs.mezzio.dev/mezzio-authentication-oauth2/v1/intro/#configuration) for all available options.
2929

3030
> You can check the [mezzio/mezzio-authentication-oauth2](https://docs.mezzio.dev/mezzio-authentication-oauth2/v1/intro/#configuration) configuration part for more info.
@@ -226,7 +226,7 @@ The client values come from `oauth_clients` and the scope from `oauth_scopes`.
226226

227227
**Q: How long do the tokens last?**
228228

229-
A: Access tokens expire after one day and refresh tokens after one month, both configurable under the `authentication` key in `config/autoload/local.php`.
229+
A: Access tokens expire after one day and refresh tokens after one month, both configurable under the `authentication` key in `config/autoload/authentication.global.php`.
230230

231231
**Q: How do I renew an expired access token?**
232232

‎docs/book/v7/introduction/file-structure.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,15 @@ This folder contains all application-related config files:
5050

5151
This folder contains all service-related local and global config files:
5252

53+
* `authentication.global.php` - Configures OAuth2 authentication: key paths, token lifetimes and the invalid credentials message
5354
* `authorization.global.php` - Configures access per route for user roles
5455
* `cli.global.php` - Configures cli
5556
* `content-negotiation.global.php` - Configures request and response formats
5657
* `cors.local.php.dist` - Configures Cross-Origin Resource Sharing, like call origin, headers, cookies
5758
* `dependencies.global.php` - Sets global dependencies that should be accessible by all modules
5859
* `development.local.php.dist` - Gets symlinked into place when enabling development mode; activates error handlers
5960
* `error-handling.global.php` - Configures and activates error logs
60-
* `local.php.dist` - Local configuration file: database credentials, application name and URL, OAuth2 key paths
61+
* `local.php.dist` - Local configuration file: database credentials, application name and URL
6162
* `local.test.php.dist` - Local configuration for functional tests
6263
* `mail.local.php.dist` - Mail configuration; e.g. sendmail vs smtp, message configuration, mail logging. Not committed: the post-install script copies it out of `dotkernel/dot-mail` during installation (in 7.0 this file is `mail.global.php`)
6364
* `mezzio.global.php` - Mezzio core config file

‎docs/book/v7/introduction/introduction.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Below is a quick overview of features in Dotkernel API and how they interconnect
2929

3030
| Feature | Purpose | Configuration |
3131
|---------------------|------------------------------------|------------------------------------------------|
32-
| OAuth2 | Authentication | config/autoload/local.php |
32+
| OAuth2 | Authentication | config/autoload/authentication.global.php |
3333
| RBAC | Authorization | config/autoload/authorization.global.php |
3434
| Content Negotiation | Request/response format validation | config/autoload/content-negotiation.global.php |
3535
| OpenAPI/Swagger | API documentation | Auto-generated |
@@ -148,7 +148,7 @@ A: REST APIs in a microservices setup, headless CMS backends, e-commerce and Saa
148148

149149
**Q: Where do I configure each feature?**
150150

151-
A: OAuth2 in `config/autoload/local.php`, RBAC in `config/autoload/authorization.global.php`, content negotiation in `config/autoload/content-negotiation.global.php`; the OpenAPI documentation is generated by `composer openapi` and configured in `config/autoload/openapi.global.php`.
151+
A: OAuth2 in `config/autoload/authentication.global.php`, RBAC in `config/autoload/authorization.global.php`, content negotiation in `config/autoload/content-negotiation.global.php`; the OpenAPI documentation is generated by `composer openapi` and configured in `config/autoload/openapi.global.php`.
152152

153153
**Q: How do I register a new module?**
154154

‎docs/book/v7/security/oauth2-security.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ These clients **must not** remain unchanged in your production environment, as t
1717

1818
## OAuth Token Lifetime and Refresh Hygiene
1919

20-
The configuration for OAuth2 tokens can be edited in `config/autoload/local.php` under the `authentication` key.
20+
The configuration for OAuth2 tokens can be edited in `config/autoload/authentication.global.php` under the `authentication` key.
2121

2222
By default, the lifetimes of the `access` and `refresh` tokens are set to one day and one month respectively.
2323
Make sure to adjust their values in accordance with your application's needs, with lower values being generally safer.
@@ -67,7 +67,7 @@ They ship with passwords equal to their names, so leaving them in place hands an
6767

6868
**Q: Where do I change token lifetimes?**
6969

70-
A: Under the `authentication` key in `config/autoload/local.php`.
70+
A: Under the `authentication` key in `config/autoload/authentication.global.php`.
7171
Defaults are one day for access tokens and one month for refresh tokens; shorter values are generally safer.
7272

7373
**Q: Can I invalidate a user's tokens before they expire?**

‎docs/book/v7/tutorials/token-authentication.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ You should see a `200 OK` response with the following JSON body:
152152
Field description:
153153

154154
- `token_type`: token type to be set when sending the `Authorization` header (example: `Authorization: Bearer eyJ0e...`)
155-
- `expires_in`: access token lifetime (modify in: `config/autoload/local.php` > `authentication`.`access_token_expire`)
155+
- `expires_in`: access token lifetime (modify in: `config/autoload/authentication.global.php` > `authentication`.`access_token_expire`)
156156
- `access_token`: generated access token (store it for later use)
157157
- `refresh_token`: generated refresh token (store it for regenerating expired access token)
158158

@@ -256,7 +256,7 @@ You should see a `200 OK` response with the following JSON body:
256256
Field description:
257257

258258
- `token_type`: token type to be set when sending the `Authorization` header (example: `Authorization: Bearer eyJ0e...`)
259-
- `expires_in`: access token lifetime (change here: `config/autoload/local.php` `authentication`->`access_token_expire`)
259+
- `expires_in`: access token lifetime (change here: `config/autoload/authentication.global.php` `authentication`->`access_token_expire`)
260260
- `access_token`: generated access token (store it for later use)
261261
- `refresh_token`: generated refresh token (store it for regenerating expired access token)
262262

@@ -392,7 +392,7 @@ A: Generating uses `grant_type: password` with a username and password; refreshi
392392

393393
**Q: How long is an access token valid?**
394394

395-
A: 86400 seconds — one day — configurable via `authentication`, `access_token_expire` in `config/autoload/local.php`.
395+
A: 86400 seconds — one day — configurable via `authentication`, `access_token_expire` in `config/autoload/authentication.global.php`.
396396

397397
**Q: I get `400 Bad Request` with "Invalid credentials". What should I check?**
398398

0 commit comments

Comments
 (0)