Skip to content

Commit

Permalink
Changed AS400 object setIdentityToken to take byte array.
Browse files Browse the repository at this point in the history
  • Loading branch information
wrightj-oss committed Dec 18, 2003
1 parent 5e35c8b commit ce7f197
Showing 1 changed file with 3 additions and 44 deletions.
47 changes: 3 additions & 44 deletions src/com/ibm/as400/access/AS400.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import java.util.StringTokenizer;
import java.util.Vector;

import com.ibm.eim.token.IdentityToken;
import com.ibm.as400.security.auth.ProfileTokenCredential;

/**
Expand Down Expand Up @@ -288,40 +287,6 @@ public AS400(String systemName, String userId)
proxyServer_ = resolveProxyServer(proxyServer_);
}

/**
Constructs an AS400 object. It uses the specified system name and identity token.
<p><i>Note: Authentication via IdentityToken is not currently supported. Support will become available in a future PTF for OS/400 V5R2 and V5R1.</i>
@param systemName The name of the server. Use localhost to access data locally.
@param identityToken The identity token to use to authenticate to the server. Must be an instance of <tt>com.ibm.eim.token.IdentityToken</tt>
**/
public AS400(String systemName, Object identityToken)
{
super();
if (Trace.traceOn_) Trace.log(Trace.DIAGNOSTIC, "Constructing AS400 object with identity token, system name: '" + systemName + "'");
if (PASSWORD_TRACE) Trace.log(Trace.DIAGNOSTIC, "identity token: " + identityToken);
if (systemName == null)
{
Trace.log(Trace.ERROR, "Parameter 'systemName' is null.");
throw new NullPointerException("systemName");
}
if (identityToken == null)
{
Trace.log(Trace.ERROR, "Parameter 'identityToken' is null.");
throw new NullPointerException("identityToken");
}
construct();
systemName_ = resolveSystem(systemName);
try {
bytes_ = store(((IdentityToken)identityToken).toBytes());
}
catch (ClassCastException e) {
Trace.log(Trace.ERROR, "Argument must be of type IdentityToken.", e);
throw new ExtendedIllegalArgumentException("identityToken", ExtendedIllegalArgumentException.PARAMETER_VALUE_NOT_VALID);
}
byteType_ = AUTHENTICATION_SCHEME_IDENTITY_TOKEN;
proxyServer_ = resolveProxyServer(proxyServer_);
}

/**
Constructs an AS400 object. It uses the specified system name and profile token.
@param systemName The name of the server. Use localhost to access data locally.
Expand Down Expand Up @@ -2641,9 +2606,9 @@ private void sendSignonRequest() throws AS400SecurityException, IOException
/**
Sets or resets the identity token for this object. Using this method will clear any set password.
<p><i>Note: Authentication via IdentityToken is not currently supported. Support will become available in a future PTF for OS/400 V5R2 and V5R1.</i>
@param identityToken The identity token. Must be an instance of <tt>com.ibm.eim.token.IdentityToken</tt>
@param identityToken The identity token.
**/
public void setIdentityToken(Object identityToken)
public void setIdentityToken(byte[] identityToken)
{
if (Trace.traceOn_) Trace.log(Trace.DIAGNOSTIC, "Setting identity token.");

Expand All @@ -2655,13 +2620,7 @@ public void setIdentityToken(Object identityToken)

synchronized (this)
{
try {
bytes_ = store(((IdentityToken)identityToken).toBytes());
}
catch (ClassCastException e) {
Trace.log(Trace.ERROR, "Argument must be of type IdentityToken.", e);
throw new ExtendedIllegalArgumentException("identityToken", ExtendedIllegalArgumentException.PARAMETER_VALUE_NOT_VALID);
}
bytes_ = store(identityToken);
byteType_ = AUTHENTICATION_SCHEME_IDENTITY_TOKEN;
signonInfo_ = null;
}
Expand Down

0 comments on commit ce7f197

Please sign in to comment.