How to get windows username with JSF? - jsf

For authentication purpose, I want to get the windows username of my users when they access to the index page. I will use this windows username to check a database and if this user is knowned, then he will be logged otherwise I will redirect him to an authentication form.
I found this (http://www.rgagnon.com/javadetails/java-0441.html) where a JSP page uses the NTML protocol to get the windows username. It works (only on IE). But...
... I would like to do the same but with JSF 2.0 technology (to have this information on the server side and use it for authentication).
Do you think it's possible?
I use Tomcat 7 with JDBCRealm and a FORM authentication method.

Related

Create a Realm in Websphere Application Server 8.5

I am looking for a simple way to create a "realm" within WAS 8.5. I am specifically looking for something similar to the APACHE realm system in which a user, upon first access to a site, is presented with a javaScript username / password dialog and, if authenticated, is allowed to use the site. In Tomcat, this is accomplished by modifying the tomcat-users.xml file, adding a username, passowrd and role. Any suggestions are appreciated.
In WebSphere it is already built in, you just need to configure repository from where you want to take users e.g internal file based, or LDAP.
Than you need to enable Application security via Global Security.
Check this page for more details Enabling security
I followed these steps to implement basic authentication. http://itcareergrowth.com/blog/2018/02/25/configuring-basic-authentication-in-web-sphere-application-server/#.WpQiSOdMGUk

Export password to ldap at the time of registration liferay

I use liferay 6.1.2 bundled with jboss, integrated with CAS for authentication. Now I want to integrate LDAP for user registration as well. Just the registration is to be done in liferay and to be exported to LDAP and authentication using CAS. The problem I am facing is that when we register in liferay, the user gets exported to LDAP, but not his password. The password will get exported to LDAP only if we log-in using the liferay login portlet. This is actually not allowed and login should be only via CAS to LDAP. Now my idea is that the password should get saved into LDAP at the time of registration itself or any similar workarounds. I have no idea how to accomplish this. Please ask if any additional information is needed.
login.create.account.allow.custom.password=true
passwords.default.policy.change.required=false
ldap.auth.method=bind
These are the extra parameters I tried.
I created an ext to accomplish this. The password is added as a modification item only when it has a change. i.e., not for the first time. I did this by extending DefaultPortalToLDAPConverter class in ext.

Creating Domino session in liferay

I have a requirement like while login in liferay i have to initiate a domino session for that user. How about the possibilities and is there any work around.
thanks in advance.
Domino needs to be configured for SSO.
Liferay and Domino servers must share the same DNS Domain.
You need to create the LtpaToken cookie manually.
I achieved this by writing a custom com.liferay.portal.security.auth.Authenticator that intercepts the username and password (after the Liferay login) and tries to login on Domino via DIIOP.
lotus.domino.Session session = lotus.domino.NotesFactory.create(hostname, username, password);
If the login succeeds you can get the LtpaToken by calling session.getSessionToken();
Just put the token into a custom Cookie called LtpaToken by default which is valid for the DNS Domain your servers share.

SSO between XPage App, Notes client and Connections

Has anybody had any success creating an XPage application that includes SSO so that the user logs into notes client and is able to open an XPage application (Database) which uses the Social Enabler to integrate Connections data into the XPage? The key to my projects success is to not need to prompt the user for their username and password (The user has just logged into notes!).
I have seen #nheidloff blog about SSO using the LTPA token between an xpage and connections, however I need this to work within the notes client. If anybody has any success in creating this, can you share any tips please.
I have blogged about a technique...
http://lotusnotus.com/lotusnotus_en.nsf/dx/authenticating-notes-users-for-web-apps-automatically....htm
To sum up, we need a LtpaToken for web-based authentication. We have ability to create an LtpaToken inside Notes client using a Java method of the session object. So my solution has two parts.
A java agent that produces a valid LtpaToken for the authenticated user on the client side. We are calling this java agent from any Lotusscript routine.
The second part is a redirection web page on any database that can be accessed anonymously. This might be a Lotusscript agent, servlet or XAgent. It will get LTPAToken and a target URL from a GET request, add the LTPAToken into cookies and redirect the user back to the target URL.
In Lotus Notes client, any Lotusscript action might call the Java agent, acquire a valid LTPAToken and launch a constructed URL which points to the redirection web page with necessary parameters.
There is a couple of bugs I have detected on Domino Web server. For details of the technique and workarounds about these bugs, you might refer to my blog entry.

JMeter with Windows Authentication?

I am using JMeter to load test some pages that reside in a SharePoint 2007 Site. The farm that contains the pages resides in a different domain than the machine running the test, and uses Windows Authenticiation. The connection to the server is over an unencrypted (non-SSL) connection. Because of this, I need to pass login credentials to the server.
How do I configure JMeter to login to the server using windows authentication?
make sure to use http sampler=JAVA
Try this
Edit based on the reply: new link
Scroll down to the Parameters section,
Username The username to authorize.
Password The password for the user.
Domain The domain to use for NTLM.
Realm The realm to use for NTLM.
Add HTTP Authorization Manager to the Thread Group.
Using [domain]username[#realm] as your Windows login example.
BASE URL: [yourdomainurl]
USERNAME: [domain\username] <- UPPERCASE ONLY
PASSOWORD: [password]
This work for my case.

Resources