jhipster会话超时配置

问题描述 投票:6回答:2

我从git下载了JHipster,并试图了解如何配置会话超时但却找不到任何web.xml或基于java的类。

你能帮我弄清楚如何配置session超时,例如20分钟?

spring security angularjs jhipster
2个回答
8
投票

这是一个Spring Boot配置。

您可以在application-*.yml文件中配置它:

server:
    port: 8080
    address: localhost
    sessionTimeout: 20000

3
投票

在您的应用程序中 - *。yml文件:

server:
    port: 8080
    address: localhost
    sessionTimeout: 20000

可以持续20分钟,但是如果你想要有更长的30分钟,你的访问令牌有效期(“tokenValidityInSeconds”属性)默认为30分钟。您可以在application.yml文件中配置此属性。

3小时= 180分钟= 10800秒的示例:

authentication:
    oauth:
        clientid: testspsyapp
        secret: mySecretOAuthSecret
        # Token is valid 3 hours
        tokenValidityInSeconds: 10800

不要忘记更改“session Timeout”属性到您的应用程序 - *。yml文件:)

server:
    port: 8080
    address: localhost
    sessionTimeout: 180000
© www.soinside.com 2019 - 2024. All rights reserved.