Is it advisable to make changes in the methods of the Secure class of play framework? Or is there a way around it?
Secure.class
no. Security.class
yes.
To make changes to the Secure.class. No, normally, it should be ok in most cases. But, you will have to extend Security
class. There are several methods in this class that have to be overridden to fit your application.
static boolean authenticate(String username, String password);
static boolean check(String profile);
static String connected();
static void onAuthenticated();
static void onDisconnect();
static void onDisconnected();
EDIT : After reading all the comments and understanding Joe's real need, here is part of the solution.
dependencies.yml
file. (Also run play dependencies
)Security
for overriding of authenticate method.onAuthenticate
method to redirect toward the page of yuor choice using redirect()
loginbox.html
in tags
folder. Code is pasted below. #{loginbox /}
That means :
#{form @authenticate()}
<label>Login</label>
<input type="text" name="username" maxlength="80"/>
<label>Password</label>
<input type="password" name="password" maxlength="80"/>
<input type="submit" class="rounded" value="Se connecter" />
#{/form}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With