FOSOAuthServerBundle access_token生命时间

btb*_*voy 14 oauth symfony access-token

如果有人正在寻找如何更改FOSOAuthServerBundle的access_token生命周期(expires_in),那么这里是如何做到的:

fos_oauth_server:
    service:
        user_provider: fos_user.user_manager
        options:
            access_token_lifetime: 20 #will set token life time to 20 seconds
Run Code Online (Sandbox Code Playgroud)

这样您还可以更改FOSOAuthServerBundle完全使用的OAuth2.0库的其他选项.

希望这篇文章可以节省一些人的时间;)享受其他重要任务和改进的美好时光;)享受

小智 4

位于官方文档中: https://github.com/FriendsOfSymfony/FOSOAuthServerBundle/blob/master/Resources/doc/configuration_reference.md

  • 这很酷。但是当我发布它时,有关此选项的文档是空的:-) 这就是为什么决定在这里发布:-) 无论如何,感谢分享这个:-) (2认同)