Missing Cross Reference Target is the sample code for MySampleLogin.java.
package com.sun.login.sample;
import java.util.*;
import com.sun.authd.*;
public class MySampleLogin extends Login {
private String userTokenId;
public MySampleLogin() throws LoginException{
System.out.println("MySampleLogin()");
}
public void init() throws LoginException {
System.out.println("MySampleLogin initialization");
}
public void validate() throws LoginException {
System.out.println("SampleLoginModule validate()");
// get the current login page
int login_page = getCurrentState();
// print out all the tokens and passwords the user entered
String[]tokens = getAllTokens();
for (int i = 0; i < tokens.length; i++) {
System.out.println(i + "->" + " " + tokens[i]);
}
if (login_page == 2) {
userTokenId = new String(getToken(1));
}
}
public String getUserTokenId() {
return new String(userTokenId);
}
public String getDescription() {
return "My Sample Login Module";
}
}
|