in Education by
Is it advisable to make changes in the methods of the Secure class of play framework? Or is there a way around it? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
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. Create a normal login page. You can do this by adding the secure dependency in your dependencies.yml file. (Also run play dependencies) Extends Security for overriding of authenticate method. Also override onAuthenticate method to redirect toward the page of yuor choice using redirect() Create a new tag loginbox.html in tags folder. Code is pasted below. Use loginbox tag in your homepage : #{loginbox /} That means : You will have a login box on homepage. When users login authenticate, they will be redirected to the page of your choice. When users login fails, they will be redirected toward the login page and will see errors there. loginbox.html #{form @authenticate()} #{/form}

Related questions

0 votes
    I'm considering the following: I have some data stream which I'd like to protect as secure as ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    I'm considering the following: I have some data stream which I'd like to protect as secure as ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 15, 2022 in Education by JackTerrance
0 votes
    We're working with play framework 2.6.21 (but we're able to reproduce it with play 2.6.19 ). ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 27, 2022 in Education by JackTerrance
0 votes
    Name popular Java Framework that is used to develop microservices. 1. Spring boot 2. Spring cloud 3. Eclipse MicroProfile 4. Both B and C 5. Both A and C...
asked Jul 25, 2021 in Technology by JackTerrance
0 votes
    Explain various interfaces used in JAVA Collection framework ?...
asked May 26, 2021 in Technology by JackTerrance
0 votes
    I built my NetBeans web project with Java 1.5 successfully, however; my linux server supports / uses Java ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    I am using a third party application and would like to change one of its files. The file is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I am using a third party application and would like to change one of its files. The file is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I am using a third party application and would like to change one of its files. The file is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I am using a third party application and would like to change one of its files. The file is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 10, 2022 in Education by JackTerrance
0 votes
    What role does OpenAI play in the development of AI ethics and governance?...
asked Feb 13, 2023 in Technology by JackTerrance
0 votes
    Streams which play vital role in gulp, has its origin from __________. A. Unix B. Node.js C. Gulpfile.js D. None of the Options E. All the options...
asked Jan 31, 2023 in Education by JackTerrance
0 votes
    As more and more new technologies get into play, risks Please answer the above question....
asked Aug 23, 2022 in Education by JackTerrance
0 votes
    When a certain event occurs, I want my website to play a short notification sound to the user. The ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 26, 2022 in Education by JackTerrance
0 votes
    When a certain event occurs, I want my website to play a short notification sound to the user. The ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
...