03-19-2012 04:43 AM
Hi,
Can i compare the username field value with one string value(like Administrator) in login.jsp? How can i compare the username value with one string in this code?
If its equal means pass the value for authentication
else i have to set username value with null.
Can anyone help me?
Here is the code for username field in login.jsp
<tr>
<td class="login_label">
<label for="username">
<fmt:message bundle="${messages}" key="label.login.username" />
</label>
</td>
<td>
<input class="login_input" type="text" name="user_name" id="username" size="22">
</td>
</tr>
Thanks Veera
03-19-2012 06:38 AM
I don't really understand your need. Why don't you use a local user management that stores only your administrator? Anyway I give my answer to your specific question 🙂
The better way is not to attach your logic to the login page, but on the authentication filter. For multiple raison but the main is that you can login to Nuxeo with other way than the login page. So must work on a central point: Authentication layer.
You need to have a little knowledge about development to do that. Here is the guide line:
You just have to contribute a new Authenticator that fail for other username than Administrator, else do the default behavior. So my piece of advice will be to create a authenticator that extends the default one:
public class AdministratorFilterAuthenticator extends ApplicationFormAuthenticator {
@Override
public UserIdentificationInfo handleRetrieveIdentity(
HttpServletRequest httpRequest, HttpServletResponse httpResponse) {
String userName = httpRequest.getParameter(usernameKey);
if ("Administrator".equals(username)) {
return super.handleRetrieveIdentity(httpRequest, httpResponse);
}
return null;
}
Finally you will have to add your authenticator to the authentication chain and declare your authenticator
<extension
target="org.nuxeo.ecm.platform.ui.web.auth.service.PluggableAuthenticationService"
point="authenticators">
<authenticationPlugin name="ADMINSITRATOR_FILTER_AUTH" enabled="true"
class="org.nuxeo.ecm.mobile.filter.ApplicationFormAuthenticator">
<needStartingURLSaving>true</needStartingURLSaving>
</authenticationPlugin>
</extension>
<extension
target="org.nuxeo.ecm.platform.ui.web.auth.service.PluggableAuthenticationService"
point="chain">
<authenticationChain>
<plugins>
<plugin>ADMINSITRATOR_FILTER_AUTH</plugin>
<plugin>WEBSERVICES_AUTH</plugin>
</plugins>
</authenticationChain>
</extension>
Hope this will help you.
03-19-2012 05:31 AM
What do you want to do exactly ?
03-19-2012 06:14 AM
Hi,
03-19-2012 06:38 AM
I don't really understand your need. Why don't you use a local user management that stores only your administrator? Anyway I give my answer to your specific question 🙂
The better way is not to attach your logic to the login page, but on the authentication filter. For multiple raison but the main is that you can login to Nuxeo with other way than the login page. So must work on a central point: Authentication layer.
You need to have a little knowledge about development to do that. Here is the guide line:
You just have to contribute a new Authenticator that fail for other username than Administrator, else do the default behavior. So my piece of advice will be to create a authenticator that extends the default one:
public class AdministratorFilterAuthenticator extends ApplicationFormAuthenticator {
@Override
public UserIdentificationInfo handleRetrieveIdentity(
HttpServletRequest httpRequest, HttpServletResponse httpResponse) {
String userName = httpRequest.getParameter(usernameKey);
if ("Administrator".equals(username)) {
return super.handleRetrieveIdentity(httpRequest, httpResponse);
}
return null;
}
Finally you will have to add your authenticator to the authentication chain and declare your authenticator
<extension
target="org.nuxeo.ecm.platform.ui.web.auth.service.PluggableAuthenticationService"
point="authenticators">
<authenticationPlugin name="ADMINSITRATOR_FILTER_AUTH" enabled="true"
class="org.nuxeo.ecm.mobile.filter.ApplicationFormAuthenticator">
<needStartingURLSaving>true</needStartingURLSaving>
</authenticationPlugin>
</extension>
<extension
target="org.nuxeo.ecm.platform.ui.web.auth.service.PluggableAuthenticationService"
point="chain">
<authenticationChain>
<plugins>
<plugin>ADMINSITRATOR_FILTER_AUTH</plugin>
<plugin>WEBSERVICES_AUTH</plugin>
</plugins>
</authenticationChain>
</extension>
Hope this will help you.
03-19-2012 06:54 AM
Hi,
03-19-2012 10:13 AM
This is in my answer, the part
03-20-2012 04:37 AM
I create an authenticator plugin and put into..nuxeo/../server/nuxeo.ear/plugin folder.
03-20-2012 05:08 AM
You must not fork our code. This is evil.
03-20-2012 07:17 AM
Sorry for that wrong work...
03-20-2012 08:12 AM
You will need to have development skills for that.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.