Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add refresh token functionality #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,35 @@ In the `security.yaml` file:
- ConnectHolland\SecureJWTBundle\Security\Guard\JWTTokenAuthenticator
```

## Refresh token
Can be implemented after requiring the suggested package.
### Configure refresh token route
In the `routes.yaml` file:
```yaml
gesdinet_jwt_refresh_token:
path: /api/token/refresh
controller: gesdinet.jwtrefreshtoken::refresh
```

In the `security.yaml` file:
```yaml
refresh:
pattern: ^/token/refresh
stateless: true
anonymous: true

access_control:
- { path: ^/api/token/refresh, roles: IS_AUTHENTICATED_ANONYMOUSLY }
```

### Configure Token duration and user identity field
In the `config/packages/gesdinet_jwt_refresh_token.yaml` file:
```yaml
gesdinet_jwt_refresh_token:
ttl: 2592000
user_identity_field: email
```

## Two Factor Authentication in JWT

### Configure Google Authenticator
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@
},
"require-dev": {
"phpunit/phpunit": "^9.1"
},
"suggest": {
"gesdinet/jwt-refresh-token-bundle": "Allows using the refresh token functionality"
}
}
Loading