In this post, we will learn how to set lifetime expiration time of passport access token in laravel. we can set personal access token expiry time longer and also event shorter using tokensExpireIn, refreshTokensExpireIn, and personalAccessTokensExpireIn methods.
we can increase token expire time of access token using tokensExpireIn(). we can increase refresh token expire time of access token using refreshTokensExpireIn(). we can increase personal access token expire time of access token using personalAccessTokensExpireIn().
Let's see bellow example to set longer time of expire access token in laravel 5 application.
Example 1: app/Provides/AuthServiceProvider.php
registerPolicies(); Passport::routes(); Passport::tokensExpireIn(now()->addDays(30)); Passport::refreshTokensExpireIn(now()->addDays(30)); Passport::personalAccessTokensExpireIn(now()->addDays(30)); } }
- How to Add Google AdSense Code in Website or blog
- https://pakainfo.com/how-to-add-google-adsense-code-in-website-or-blog/
- Filter – Limit the length of string using AngularJS
- https://pakainfo.com/filter-limit-length-string-using-angularjs/
- Vue Toggle Switch Component ON-OFF
- https://pakainfo.com/vue-toggle-switch-component-on-off/
- authentication login with username or email in laravel
- https://pakainfo.com/authentication-login-with-username-or-email-in-laravel/
- PHP String Email word-char limit timestamp Examples
- https://pakainfo.com/php-string-email-word-char-limit-timestamp-examples/
- PHP Laravel Validation Example Tutorial From Scratch
- https://pakainfo.com/php-laravel-validation-example-tutorial-scratch/
- How to Import and Export CSV Files Using Codeigniter and MySQL
- https://pakainfo.com/how-to-import-and-export-csv-files-using-codeigniter-and-mysql/
- Simple jQuery Form Validator validation
- https://pakainfo.com/simple-jquery-form-validator-validation/
- Laravel Installer Create Web Application install scripts
- https://pakainfo.com/laravel-installer-create-web-application-install-scripts/
- PHP Secure Token Generator Authentication tutorial
- https://pakainfo.com/php-secure-token-generator-authentication-tutorial/
No comments :
Post a Comment