Authentication of RSA Passcode :: RSA API using Java


Hi,

In this blog post, lets see the java code to interact is RSA Authentication agent for Passcode code validation. You can use below code to create multifactor authentication for your systems. At the same time, even if you add interface code to SMS gateway or API to send passcode to the user mobile number.

Java code:

boolean authStatus = false;
        try
        {
            AuthSessionFactory api = AuthSessionFactory.getInstance(configfilePath);
            AuthSession authSession = api.createUserSession();
            int status = authSession.check(username, password);
          if (status == AuthSession.ACCESS_OK){
                      authStatus= true;
        }
        catch (Exception e){
                // message or error handling
}
finally{
            authSession.close();
            api.shutdown();
}

RSA Library required:

Authapi.jar


About vtm

Well done is better than Well Said!!! Web Enthusiast, Blogger, Open source contributor!!! And Web/Software Consultant for Personal and Business

Leave a comment

Your email address will not be published. Required fields are marked *

two × two =