Hello everyone,
Today I would like to share with you one error that took 2 days to get it fixed.
Running WebSphere over a RAD eclipse environment I've configured all the details related of JDBC connection, libraries needed for the project and so on.
But it fails in LDAP piece giving an error once I try to login in my application:
Error 404: java.io.FileNotFoundException: SRVE0190E: File not found: /j_security_check
Here it's what I had in my WebSphere configured at that time for Ldap:
The problem is: when you have an LDAP authentication available for you application that's using WebSphere 8.5, it needs as well a security enable configuration, using a valid userID and password for LDAP purposes. So, you must configure this click two times in your WebSphere App Server in the Eclipse RAD server tab.
So, once you configure it properly your app should be generating the /j_security_check file. And your Admin Console should be login only with a valid ldap_user and password as below:
I hope it helps and fix your ldap/app issues.
happy coding!!
Thiago Leoncio.
Thiago - Tech Director, Principal Architect and software developer for many different languages. I am passionate about the development of any kind. I am a developer since 1996, coding for many different styles such as Cold Fusion, Java, PHP, PL-SQL, Objective-C, Nodejs and many others..anything needed we can translate to code.
Saturday, October 8, 2016
How to use waffle library for JNA (Java Native Access)
Hello everyone,
I would like to show you guys how to use waffle library for JNA (Java Native Access).
So, coding time...
[Source Code]
package thiago.leoncio;
import com.sun.jna.platform.win32.Sspi;
import com.sun.jna.platform.win32.Sspi.SecBufferDesc;
import waffle.windows.auth.IWindowsSecurityContext;
import waffle.windows.auth.impl.WindowsAuthProviderImpl;
import waffle.windows.auth.impl.WindowsSecurityContextImpl;
/**
* @author THiago
* @Date 10/08/2016
* @Description: How to get details from current machine.
* @libs for JNA(jna.jar;jna-min.jar;jna-platform.jar;guava-18.0.jar;waffle-jna-1.8.0.jar)
*/
public class Authenticator {
public static void main(String args[]) {
IWindowsSecurityContext clientContext = WindowsSecurityContextImpl.getCurrent( "Negotiate", "localhost" );
// create an auth provider and a security context for the client
// on the server
WindowsAuthProviderImpl provider = new WindowsAuthProviderImpl();
IWindowsSecurityContext serverContext = null;
do {
if (serverContext != null) {
byte[] tokenForTheClientOnTheServer = serverContext.getToken();
SecBufferDesc continueToken = new SecBufferDesc(Sspi.SECBUFFER_TOKEN, tokenForTheClientOnTheServer);
clientContext.initialize(clientContext.getHandle(), continueToken, "localhost");
}
byte[] tokenForTheServerOnTheClient = clientContext.getToken();
serverContext = provider.acceptSecurityToken("server-connection", tokenForTheServerOnTheClient, "Negotiate");
} while (clientContext.isContinue());
// client is, only by exchanging byte[] arrays
System.out.println(serverContext.getIdentity().getFqn());
}
}
[Output]
networkName\userID
as I explained in previous blog:
"
On top of JNA exists a library called Waffle which encapsulates all functionality you need to implement user authentication. Get from GitHub at https://github.com/dblock/waffle and also on Maven central. To download the jar files get from here: https://github.com/dblock/waffle/releases/download/Waffle-1.8.0/Waffle.1.8.zip
"
Please, see this JNA and Waffle article also:
http://phonecoding.com/2016/06/how-to-get-details-from-current-machine.html
Happy coding..
Thiago Leoncio.
I would like to show you guys how to use waffle library for JNA (Java Native Access).
So, coding time...
[Source Code]
package thiago.leoncio;
import com.sun.jna.platform.win32.Sspi;
import com.sun.jna.platform.win32.Sspi.SecBufferDesc;
import waffle.windows.auth.IWindowsSecurityContext;
import waffle.windows.auth.impl.WindowsAuthProviderImpl;
import waffle.windows.auth.impl.WindowsSecurityContextImpl;
/**
* @author THiago
* @Date 10/08/2016
* @Description: How to get details from current machine.
* @libs for JNA(jna.jar;jna-min.jar;jna-platform.jar;guava-18.0.jar;waffle-jna-1.8.0.jar)
*/
public class Authenticator {
public static void main(String args[]) {
IWindowsSecurityContext clientContext = WindowsSecurityContextImpl.getCurrent( "Negotiate", "localhost" );
// create an auth provider and a security context for the client
// on the server
WindowsAuthProviderImpl provider = new WindowsAuthProviderImpl();
IWindowsSecurityContext serverContext = null;
do {
if (serverContext != null) {
byte[] tokenForTheClientOnTheServer = serverContext.getToken();
SecBufferDesc continueToken = new SecBufferDesc(Sspi.SECBUFFER_TOKEN, tokenForTheClientOnTheServer);
clientContext.initialize(clientContext.getHandle(), continueToken, "localhost");
}
byte[] tokenForTheServerOnTheClient = clientContext.getToken();
serverContext = provider.acceptSecurityToken("server-connection", tokenForTheServerOnTheClient, "Negotiate");
} while (clientContext.isContinue());
// client is, only by exchanging byte[] arrays
System.out.println(serverContext.getIdentity().getFqn());
}
}
[Output]
networkName\userID
as I explained in previous blog:
"
On top of JNA exists a library called Waffle which encapsulates all functionality you need to implement user authentication. Get from GitHub at https://github.com/dblock/waffle and also on Maven central. To download the jar files get from here: https://github.com/dblock/waffle/releases/download/Waffle-1.8.0/Waffle.1.8.zip
"
Please, see this JNA and Waffle article also:
http://phonecoding.com/2016/06/how-to-get-details-from-current-machine.html
Happy coding..
Thiago Leoncio.
Saturday, October 1, 2016
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/cache/CacheBuilder on WindowsAuthProviderImpl class
Hey guys,
Recently I was working with JNA using Waffle to get the user details, and at same time creating a token on client side, in order to create a trust relationship between the targets.. Then i got this issue that I would like to share how to fix:
On top of JNA exists a library called Waffle which encapsulates all functionality you need to implement user authentication. Get from GitHub at https://github.com/dblock/waffle and also on Maven central. To download the jar files get from here: https://github.com/dblock/waffle/releases/download/Waffle-1.8.0/Waffle.1.8.zip
Using waffle project I got this error recently:
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/cache/CacheBuilder
at waffle.windows.auth.impl.WindowsAuthProviderImpl.<init>(WindowsAuthProviderImpl.java:68)
at waffle.windows.auth.impl.WindowsAuthProviderImpl.<init>(WindowsAuthProviderImpl.java:58)
at thiago.leoncio.Authenticator.main(Authenticator.java:19)
Caused by: java.lang.ClassNotFoundException: com.google.common.cache.CacheBuilder
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
To fix this you must add the library that has all google classes. It's name is guava-18.0.jar and of course the waffle one: waffle-jna-1.8.0.jar
Please, check this JNA and Waffle article also: http://phonecoding.com/2016/10/how-to-use-waffle-library-for-jna-java.html
I hope this helps,
Thiago Leoncio.
Subscribe to:
Posts (Atom)