Enforce Https routing for login with play framework

后端 未结 6 2156
滥情空心
滥情空心 2020-12-05 03:22

I want to enforce https routing for the login page only of my application.

Is it possible to do so with Play! without the use of a front end http server?

6条回答
  •  遥遥无期
    2020-12-05 03:39

    You should be able. Do the following:

    1. Set up http.port and https.port in the application.config file
    2. User @@{Controller.action().secure()} when you need to point to a secure page. Use both @@ to generate a full url (including https) and secure to hint to Play you want HTTPS protocol

    This should work

提交回复
热议问题