NCPassClient (PSUTwoFactor) is a simple java libray for validating SecurID tokens using the mainframe based NCPass application.
To install PSUTwoFactor, download the latest release from the releases page.
To build PSUTwoFactor from source, follow these steps:
- Clone the repository:
git clone https://github.com/mark-iid/psutwofactor.git
- Navigate to the project directory:
cd psutwofactor - Compile the project using Maven:
mvn clean install
This will generate the psutwofactor-x.y.z.jar file in the target directory, where x.y.z is the version number.
Here is a basic example of how to use PSUTwoFactor:
package edu.psu.its.twofactor;
public class TestTwoFactor {
public static void main(String[] args) {
// Instantiate a PSUAuthenBy2ndFactor object:
PSUAuthenBy2ndFactor aTwoFactor = new PSUAuthenBy2ndFactor("ncpass.server", 0);
PSUResponse aResponse = aTwoFactor.doAuthen("testapp", "username", "000000");
if (aResponse.isSuccessful()) {
System.out.println("Authen Result: Successful");
} else {
System.out.println("Authen Result: Failed; Error Code=" + aResponse.getCode() + "; ErrorMsg=" + aResponse.getUserMessage());
}
}
}Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.