I have developed a Worklight Web/Mobile website using AngularJS using Mobilefirst V7.0. I want to protect the URL of my web Application such that if some user directly tries to type the URL(for Ex:www.mydomain/app/dashboard) in the address bar with out proper Authentication, he should be pushed to login page for providing credentials(username/password), rather than forwarding to dashboard page . I'm used worklight AdapterbasedAuthentication for Authentication the user,using challangeHandler. Now I want to protect the WebSite URLs and Worklight console. Anyone can please tell me how to implement this in worklight. Please provide me some code for doing so if possible. Thank you everyone in advance.
Edit Hi Idan Adar,thaks for your response. The below following is my task to do: I'm trying to protect my Website Urls under tag by configuring in authenticationconfig.xml file, and when some ananymous user tries to access website by entering url manually, I'm trying to show the default worklight login.html page. On executing the below code I'm getting challangeHandler object in the browser and I'm not getting the login.html page which i required. Can you please suggest and tell me how to show the login.html page on unauthorized url access and suggest some solution to fix this issue.
<staticResources>
<resource id="logUploadServlet" securityTest="myWebUrlTest">
<urlPatterns>/apps/services/preview/myProject/common/1.0/default/index.html/*</urlPatterns>
</resource>
</staticResources>
<securityTests>
<webSecurityTest name="myWebUrlTest">
<testUser realm="SampleAppRealm"/>
</webSecurityTest>
</securityTests>
<realms>
<realm name="SampleAppRealm" loginModule="StrongDummy">
<className>com.worklight.core.auth.ext.FormBasedAuthenticator</className>
<parameter name="login-page" value="login.html" />
</realm>
</realms>
<loginModules>
<loginModule name="StrongDummy" expirationInSeconds="-1">
<className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
</loginModule>
</loginModules>