Passing uname/pwd to Socket

Hi,
I want to connect to Telnet using Socket by passing the uname/password, here is the pgm:-
public static void main(String[] args) throws Exception {
Socket mySocket = null;
PrintWriter out = null;
BufferedReader in = null;
try {
InetAddress address = InetAddress.getByName("111.123.1.123");
System.out.println("trying to connect .....");
mySocket = new Socket(address,23);
System.out.println("connected .... ");
out = new PrintWriter(mySocket.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(
mySocket.getInputStream()));
} catch (UnknownHostException e) {
System.err.println("Don't know about host: " );
System.exit(1);
} catch (IOException e) {
System.err.println("Couldn't get I/O for "
+ "the connection to: ");
System.exit(1);
Since the Socket class doesnot take the uname/pwd how to pass those? and once the login is successful, i need to invoke a particular command in that machine (111.123.1.123)? like "exec -data" (in windows which does have this 3rd party lib)? How to do this through the Socket programming. Please clarify.
Thanks

I used some 3rd party Telnet Client, which is Apache common/net. But is having a lot of problem, i am unable to invoke multiple command through it like "cd\", "c:\jdk\bin"? Is there any other Telnet "lib" that can be used to connect to the remote machines.
"SSH is secure but it is used ion linux env as supposed to windows. In windows we need to have dedicated server with SSH conf. to send the request to another remote machines. Hence i am looking for Telnet client right now.
Thanks.

Similar Messages

  • Passing info over a socket

    lets say I read in a vector from a file on a server, and I want to read the vector into another vector on the client side. I know the clients objectinputstream is the servers objectoutputstream, but how to I send objects over a socket connection.
    Thanks.

    client:
    public class Client implements Serializable
    Socket socket;
    // PrintWriter out;
    Vector userPass, guestBooks;
    BufferedReader inp;
    public Client()
    try
    socket = new Socket("13", 60);
    // out = new PrintWriter(socket.getOutputStream(), true);
            ObjectInputStream in = new ObjectInputStream(socket.getInputStream());
            Object o1 = in.read();
            Object o2 = in.read();
            in.close();
    catch(IOException e)
    e.printStackTrace();
    Server:
    public class Server implements Serializable
    ServerSocket sock;
    Socket clnt;
    File file1, file2, file3;
    FileInputStream fis1, fis2, fis3;
    Vector userspass, guestbooks;
    public Server()
    try
    sock = new ServerSocket(60);
    System.out.println("Listening on: Port 60");
    clnt = sock.accept();
    file1 = new File("user.txt");
    file2 = new File("guestb.txt");
    fis1 = new FileInputStream(file1);
    fis2 = new FileInputStream(file2);
    ObjectInputStream in1 = new ObjectInputStream(fis1);
    ObjectInputStream in2 = new ObjectInputStream(fis2);
    userspass = new Vector();
    guestbooks = new Vector();
    try //read in the object from the file to the vectors
    while(in1.readObject()!= null)
    userspass.add(in1.readObject());
    while(in2.readObject()!= null)
    guestbooks.add(in2.readObject());
              // here you want to send the vectors to the client?
              ObjectOutputStream out = new ObjectOutputStream(clnt.getOutputStream());
              out.write(userspass);
              out.write(guestbooks);
              out.close();
    catch(Exception ex)
    ex.printStackTrace();
    sock.close();
    sock.close();
    catch(IOException e)
    e.printStackTrace();
    }Something like that. I have never used Object streams myself, so there's probably more to it (like making sure that vectors are serializable, and/or the contents in them). Also I'm not sure if closing the Object stream will close the socket's I/O stream also.... something for you to test and see.
    HTH,
    Radish21

  • WLST modified db uname/pwd verification for JDBC resource-No Restart Server

    Hi,
    I have created a WLST script for changing the db username and password for a particular jdbc resource.It is working fine.
    But to verify whether the right username and password has been provided ,is there a way to test the db connection for the changed user name and password without restarting the server.
    I also understand that there would be the cached connections of the previous user name and password for the jdbc resource.
    Please let me know if I can do this using any API's in WLST or any other way.
    Idea is to execute the change db user name and password and verification in one go.
    Cheers,
    Mohan

    You could try something like
    servers = domainRuntimeService.getServerRuntimes();
    # this return an array, for example array(weblogic.management.runtime.ServerRuntimeMBean,[[MBeanServerInvocationHandler]com.bea:Name=AdminServer,Location=AdminServer,Type=ServerRuntime])
    # we obtain the server to which the datasource is targetted
    admin = servers[0];
    jdbcruntime = admin.getJDBCServiceRuntime();
    datasources = jdbcruntime.getJDBCDataSourceRuntimeMBeans();
    # this returns an array of the active datasources on the server, for example array(weblogic.management.runtime.JDBCDataSourceRuntimeMBean,
    # [[MBeanServerInvocationHandler]com.bea:ServerRuntime=AdminServer,Name=ExampleDataSource,Location=AdminServer,Type=JDBCDataSourceRuntime])
    datasource = datasources[0];
    # Reset the connection pool in the data source by shutting down and recreating all available database connections in the pool.
    datasource.reset();
    # Test the connection pool in the data source by reserving and releasing a connection from it.
    test = datasource.testPool();
    # Print out information about all the connections in the connection pool in the data source, if there are any.
    datasource.dumpPool();

  • Dear all, I found that I can't upload attach to yahoo or gmail using firefox5 as it keeps asking me the authen.. I input the right uname&pwd, the attach stuck. It works fine on IE.. Thanks for help!!!

    I found that I cannot upload any attachment to yahoo or gmail using firefox 5 as it always keep asking me the authentication. Even I input the right, the attachment stuck. It works fine on IE.. Thanks!!!

    Look here:
    http://discussions.apple.com/thread.jspa?messageID=10609826&#10609826

  • Problem in passing byte through socket

    Hi to all,
    I'm trying to pass a byte[] through socket.
    The code where the data is sent is the following:
    byte[] data = new byte[len];
    // read the byte[] from another InputStream
    inStream.read(data, 0, len);
    // carry data to another OutputStream
    handler.out.println("$crypted_obj "+len+" "+pcol_step); //handler.out is a PrintWriter
    handler.incoming.getOutputStream().write(data);
    handler.incoming.getOutputStream().flush();I try to read in this way:
    byte[] data = new byte[len];
    is.read(data, 0, len);When the read is launched for the first time, it return only an array full of zeros, the other times return the right data array.
    I have tried to use BufferedInputStream and BufferedOutputStream but it's the same.
    In debugging mode(Eclipse) all work fine.
    Anyone have a suggestion for solve this problem?
    Thanks in Advice
    Manuel

    But why the sender don't write the bytes?Because the length is wrong, or you have a bug in your sending code which you haven't posted yet.
    Before of the byte[] data I sent a string through a PrintWriter that work on the same OutputStream. The string arrive correctly.Don't use two kinds of streams or Readers or Writers on the same stream. It doesn't work.
    os.write(data); //this is not sent!It is if you flush it.

  • Problem about Non-blocking socket's read and write

    my aim is:when I open a socketchannel,I can use this socket which can continue send and get messages!(for example:open a socket,send a loging message,server echo,if passed,use the same socket sending other message,get echo messages....
    Here is problem sample codes:
    void ConnectServer() throws IOException
    bf = ByteBuffer.allocateDirect(1024);
    InetSocketAddress ad = new InetSocketAddress(this.servername,this.serverport);
    this.clientsocketchannel = SocketChannel.open(); //set socketchannel
    this.clientsocketchannel.configureBlocking(false);
    this.clientsocketchannel.connect(ad);
    this.slt = Selector.open();
    this.clientsocketchannel.register (this.slt,SelectionKey.OP_CONNECT|SelectionKey.OP_READ|SelectionKey.OP_WRITE);
    //send data
    private void SendMessage(byte[] SendMessage)throws IOException
    while (this.slt.select() > 0)//sth wrong!when I test,slt.select(500)=0
    Set readykey = slt.selectedKeys();
    Iterator readyitor = readykey.iterator();
    while (readyitor.hasNext())
    SelectionKey skey = (SelectionKey) readyitor.next();
    readyitor.remove();
    if (skey.isWritable())
    SocketChannel keychannel = (SocketChannel) skey.channel();
    keychannel.write(ByteBuffer.wrap(this.sendmessage));
    }//end while
    }//end while
    //get data
    private void GetEchoMessage()throws IOException
    while(this.slt.select(500) > 0)//sth wrong!when I test,slt.select(500)=0
    Set readykey = slt.selectedKeys();
    Iterator readyitor = readykey.iterator();
    while (readyitor.hasNext())
    SelectionKey skey = (SelectionKey) readyitor.next();
    readyitor.remove();
    if (skey.isWritable())
    SocketChannel keychannel = (SocketChannel) skey.channel();
    keychannel.read(bf);
    public static void main(String[] arg)
    connectserver(..);
    SendMessage(...);
    GetEchoMessage();
    SendMessage(...);
    GetEchoMessage();

    private void ConnectServer() throws IOException
    � bf = ByteBuffer.allocateDirect(1024);
    �� InetSocketAddress ad = new InetSocketAddress(this.servername,this.serverport);
    �� this.clientsocketchannel = SocketChannel.open(); //set
    socketchannel
    �� this.clientsocketchannel.configureBlocking(false);
    �� this.clientsocketchannel.connect(ad);
    �� this.slt = Selector.open(); � this.clientsocketchannel.registerthis.slt,SelectionKey.OP_CONNECT|SelectionKey.OP_READ|SelectionKey.OP_WRITE);
    <b>
    //send data</b>
    private void SendMessage(byte[] SendMessage)throws IOException
    � while (this.slt.select() > 0)//<font color="#FF0000"><i>wrong,when test,this.slt.select(500)=0,why??</i></font>
    �{
    ��� Set readykey = slt.selectedKeys();
    ��� Iterator readyitor = readykey.iterator();
    ��� while (readyitor.hasNext())
    ��� {
    ������ SelectionKey skey = (SelectionKey) readyitor.next();
    ������ readyitor.remove();
    ������ if (skey.isWritable())
    ������ {
    �������� SocketChannel keychannel = (SocketChannel) skey.channel();
    �������� keychannel.write(ByteBuffer.wrap(this.sendmessage));
    ������ }
    ��� }//end while
    � }//end while�
    <b>
    //get data</b>
    private void GetEchoMessage()throws IOException
    � while(this.slt.select(500) > 0)<font color="#FF0000"><i>//wrong,when
    test,this.slt.select(500)=0</i></font>
    � {
    ��� Set readykey = slt.selectedKeys();
    ��� Iterator readyitor = readykey.iterator();
    ��� while (readyitor.hasNext())
    ��� {
    ����� SelectionKey skey = (SelectionKey) readyitor.next();
    ����� readyitor.remove();
    ����� if (skey.isWritable())
    ����� {
    ������� SocketChannel keychannel = (SocketChannel) skey.channel();
    ������� keychannel.read(bf);
    ����� }
    ��� }
    � }
    public static void main(String[] arg)
    � ......
    � connectserver(..);
    � SendMessage(...);
    � GetEchoMessage();
    � .......
    � SendMessage(...);
    � GetEchoMessage();
    � .......

  • Disabling Test Sockets in SinglePass.

    I am new to TestStand and LabWindows and am trying to figure out how to
    pass serial number and socket status to a sequence file from a
    LabWindows application. I have an application that successfully opens a
    sequence file and executes it via the TestStand API. I can probably
    figure out a way to pass serial numbers and socket status via the
    Parameters.ModelData.TestSockets[x] sub property. The problem is that
    it appears that SinglePass is waiting for all the test sockets to
    complete whether they are enabled or not. It seems to never get out of
    the step "Wait For TestSockets" under the SinglePass entry point.
    Is there an easy way to do this? I really don't want to use the
    TestUUT's entry point. Should I just customize the SinglePass entry
    point with logic in the "Wait For TestSockets"  loop or is there a
    much easier way to do this?
    Thanks,
    John

    Hello John,
    To answer your first question, generally to pass information
    back and forth between an operator interface and a sequence you should have
    your sequence post a UIMessage, and your operator interface reads the message
    and responds.  If you look at the
    PostUIMessage help you see the following definition:
    Thread.PostUIMessageEx ( eventCode, numericDataParam,
    stringDataParam, activeXDataParam, synchronous)
    You can pass data with the message, and since the
    activeXDataParam is passed by reference you can update the value and use it in
    your sequence file.  This is how you
    could send a serial number between the Operator interface and the sequence
    file.
    Next, you mention that you are having problems with test
    sockets waiting for disabled test sockets.  I think this is probably due to
    how the disabled flag is being set.  We
    have been able to disable a test socket if the user does not type in a serial
    number (in the batch process), by modifying the batchuutdlg.c in the
    modelsupport2.prj.  We first declared a
    variable static char string[200]; and in the goCallback we added the following
    instead of the statement at line 932.
    GetCtrlVal(childPanel,
    panelData->testSocketDataArray[i].ctrls[kTSCtrl_SerialNum], string);
    if (!strcmp(string, ""))
                tsErrChkMsgPopup(
    TS_PropertySetValBoolean (panelData->testSocketDataArray[i].testSocket,
    &errorInfo, TEST_SOCKET_DISABLED, 0, (VBOOL)(VTRUE)));
    I hope you find this example helpful.
    Regards,
    Jesse O
    Applications Engineering
    National Instruments
    Jesse O. | National Instruments R&D

  • OIM 9.1 and ADSync Connecter from 9041 (Version: 4.5.0) issues

    Has anyone successfully configured these two together yet? I am in the process of trying to configure it properly and during the process of changing the User Defined field, it is giving a tcStaleDataUpdateException.
    Below is the full log of a password change cycle:
    05 Mar 2008 15:46:32 INFO Logger created
    05 Mar 2008 15:46:32 INFO Triggering Password Synchronization mechanism
    05 Mar 2008 15:46:34 INFO Value of the installedFlag=>true
    05 Mar 2008 15:46:34 INFO Password Reset Installed..get the ITResourceType and
    ITResourceName
    05 Mar 2008 15:46:34 INFO IT ResourceType Name=>AD Server
    05 Mar 2008 15:46:34 INFO ITResourceName=>OIM-WGC
    05 Mar 2008 15:46:34 INFO Logging to OIM server
    05 Mar 2008 15:46:34 INFO Logging into OIM Server with an auth mechanism
    05 Mar 2008 15:46:34 INFO Necassary Configurations read
    05 Mar 2008 15:46:34 INFO Logging into OIM Server with uname/pwd based auth
    05 Mar 2008 15:46:41 INFO Logging into OIM Server with uname/pwd based auth
    05 Mar 2008 15:46:41 INFO Initializing API instances
    05 Mar 2008 15:46:41 INFO Login completed
    05 Mar 2008 15:46:41 INFO Get the value of IT Resource parameter
    05 Mar 2008 15:46:43 INFO Set the value of IT Resource parameter to LDAP connec
    tion variables
    05 Mar 2008 15:46:43 INFO Check whether the ADsync is activated through ADServe
    r or OIM user
    05 Mar 2008 15:46:43 INFO Inside checkOIMFlag
    05 Mar 2008 15:46:43 INFO Going to connect AD
    05 Mar 2008 15:46:43 INFO Successful connected to AD
    05 Mar 2008 15:46:43 INFO Check the value of the customAtrributeName
    05 Mar 2008 15:46:43 INFO Enumerate the attributes
    05 Mar 2008 15:46:43 INFO objectGUID-->01afea406b229543b856de73305de058
    05 Mar 2008 15:46:43 INFO samName-->BW140435
    05 Mar 2008 15:46:43 INFO userPrincipalName-->BW140435
    05 Mar 2008 15:46:43 INFO User Defined field value-->0
    05 Mar 2008 15:46:43 INFO Custom Atrribute value is 0
    05 Mar 2008 15:46:43 INFO return from checkOIMFlag
    05 Mar 2008 15:46:43 INFO Password for this user needs to be updated through sy
    nchronization
    05 Mar 2008 15:46:43 INFO userId--->BW140435
    05 Mar 2008 15:46:43 INFO matchType--->UserID
    05 Mar 2008 15:46:43 INFO Inserted BW140435 in Input
    05 Mar 2008 15:46:43 INFO Find the user in OIM :
    05 Mar 2008 15:46:43 INFO After findUser :: userRS.size : 1
    05 Mar 2008 15:46:43 INFO User BW140435 = 71
    05 Mar 2008 15:46:43 INFO Set the value of UDF field to ADSYNC_TRUE value
    05 Mar 2008 15:46:43 INFO Going to update the USR_UDF_ADSYNC to ADSYNC_TRUE
    05 Mar 2008 15:46:45 INFO update the value of USR_UDF_ADSYNC to ADSYNC_TRUE
    05 Mar 2008 15:46:45 INFO Invoking OIM API for setting password
    05 Mar 2008 15:46:46 INFO Password changed
    05 Mar 2008 15:46:46 ERROR Unable to update status
    Thor.API.Exceptions.tcStaleDataUpdateException
    at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:290)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:248)
    at com.thortech.xl.ejb.beans.tcUserOperations_voj9p2_EOImpl_816_WLStub.updateUser(Unknown Source)
    at Thor.API.Operations.tcUserOperationsClient.updateUser(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.security.Security.runAs(Security.java:41)
    at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(Unknown Source)
    at Thor.API.Base.SecurityInvocationHandler.invoke(Unknown Source)
    at $Proxy0.updateUser(Unknown Source)
    at com.thortech.xl.integration.adpasswordsynch.ChangePassword.changePassword(Unknown Source)
    at com.thortech.xl.integration.adpasswordsynch.ChangePassword.main(Unknown Source)
    Caused by: Thor.API.Exceptions.tcStaleDataUpdateException
    at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUserData(Unknown Source)
    at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUser(Unknown Source)
    at com.thortech.xl.ejb.beans.tcUserOperationsSession.updateUser(UnknownSource)
    at com.thortech.xl.ejb.beans.tcUserOperations_voj9p2_EOImpl.updateUser(tcUserOperations_voj9p2_EOImpl.java:2302)
    at com.thortech.xl.ejb.beans.tcUserOperations_voj9p2_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:491)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:120)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:434)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:429)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    05 Mar 2008 15:46:46 INFO Set the value of UDF field to ADSYNC_FALSE value
    05 Mar 2008 15:46:46 INFO Going to update the USR_UDF_ADSYNC to ADSYNCH_FALSE
    05 Mar 2008 15:46:46 ERROR Unable to update status
    Thor.API.Exceptions.tcStaleDataUpdateException
    at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:290)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:248)
    at com.thortech.xl.ejb.beans.tcUserOperations_voj9p2_EOImpl_816_WLStub.updateUser(Unknown Source)
    at Thor.API.Operations.tcUserOperationsClient.updateUser(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.security.Security.runAs(Security.java:41)
    at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(Unknown Source)
    at Thor.API.Base.SecurityInvocationHandler.invoke(Unknown Source)
    at $Proxy0.updateUser(Unknown Source)
    at com.thortech.xl.integration.adpasswordsynch.ChangePassword.changePassword(Unknown Source)
    at com.thortech.xl.integration.adpasswordsynch.ChangePassword.main(Unknown Source)
    Caused by: Thor.API.Exceptions.tcStaleDataUpdateException
    at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUserData(Unknown Source)
    at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUser(Unknown Source)
    at com.thortech.xl.ejb.beans.tcUserOperationsSession.updateUser(UnknownSource)
    at com.thortech.xl.ejb.beans.tcUserOperations_voj9p2_EOImpl.updateUser(tcUserOperations_voj9p2_EOImpl.java:2302)
    at com.thortech.xl.ejb.beans.tcUserOperations_voj9p2_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:491)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:120)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:434)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:429)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    05 Mar 2008 15:46:46 INFO Password synch over
    05 Mar 2008 15:46:46 INFO Before System.exit(0):
    -Kevin

    For anyone else trying to setup AD Sync with 9.1, i was able to resolve the issue by decompiling the ChangePassword.class file and rewrite the changePassword method.
    The cause for the error was due to prior to the password change, the user defined field is changed, and after the password change, the same ResultSet is being used when the next value is being written to the field. Since the data had changed, the latest Exception handling would not allow the change due to the ResultSet being old/stale data.
    Also, you will run into a looping issue for bi-direction password resets because when you make a change in AD, the password in OIM is reset, which triggers the Change User Password task, which triggers the Password Updated if you are just returning the new password to the Password field, which tries to reset the password in AD again. This will lock up the domain controller. To get around this, you need to create custom code to check the value of the user defined field. If it's true, then run the setProcessData of the AD User form, otherwise, just stop.
    And finally, on the AD Set User Password adapter, you will need to set the adsync schema attribute to 1 prior to the password reset, to prevent the passing of the value onto OIM again. After the password change is complete, change the adsync attribute back to 0.
    -Kevin

  • [Oracle][ODBC][Ora]ORA-01017: invalid username/password; logon denied

    ---cmd prompt------------------------
    H:\>sqlplus scott/tiger
    SQL*Plus: Release 10.2.0.3.0 - Production on Sun Mar 28 16:54:53 2010
    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL>
    -------------ASP -------------------------
    <%@ Language="JScript" %>
    <%
         var uname=Request.Form("un");
         var upwd=Request.Form("pwd");
         Response.Write("User Name is " + uname + "<br>" + "password is " + upwd);
         var sql = "select * from emp";
         var conn = Server.CreateObject("ADODB.Connection");
         var rs = Server.CreateObject("ADODB.Recordset");
         conn.Open = "Driver={Oracle in OraDb10g_home1};DBQ=tcp;UID='uname';PWD='upwd';";
         rs.Open(sql, conn, 3, 3);
    %>
    ------------------Error------------------
    User Name is scott
    Password is tiger
    Microsoft OLE DB Provider for ODBC Drivers error '80040e4d'
    [Oracle][ODBC][Ora]ORA-01017: invalid username/password; logon denied
    /prc/main.asp, line 11
    variable uname has valid username that is 'scott' and variable upwd as valid password ie 'tiger' both entered by the user.
    with the same username and password i am able to connect to the database from the command prompt.
    but when i tried using odbc through ASP(javascript) i am getting above error.
    and one more thing if i mention username and password directly in UID and PWD it works but when i pass it through variables it wont work.
    since variables have username and password it has to take from it directly...........manually i cant give,dynamically it has to take.
    plz help me out....how i can pass the parameter to that UID and PWD.
    conn.Open = "Driver={Oracle in OraDb10g_home1};DBQ=tcp;UID='uname';PWD='upwd';";
    help plz
    conn.Open = "Driver={Oracle in OraDb10g_home1};DBQ=tcp;UID='uname';PWD='upwd';"; --- does not work
    conn.Open = "Driver={Oracle in OraDb10g_home1};DBQ=tcp;UID=scott;PWD=tiger;"; --- works
    but i want the 1st statement to work........since user gives the password and username dynamically.
    Thanks
    Veeresh S

    conn.Open("DSN=tcp;UID="+uname+";PWD="+upwd+";");
    this solved me
    thanks for all who had vied this..
    veeresh

  • How set  UserName and Password for HTTP Basic Authentication for a servlet

    Hi..
    How set UserName and Password for HTTP Basic Authentication for a servlet in JBoss server?
    Using Tomcat i can do it .(By setting roles in web.xml, and user credintails in tomcat-user.xml).
    But i dont know how do it in JBOSS..
    I am using Netbeans and Eclipse IDEs.. Can we do it by using them also!?
    Thank u

    Hi Raj,
    You can do this by creating a Login screen for the users and check the authentication of each user in PAI i.e. PROCESS AFTER INPUT.
    Store the user information in a database table and check the username and password when the user enters it.
    You can display password as *** also. For this double click on input box designed for password and goto Display tab. Select Invisible in the list and check it.
      CASE sy-ucomm.
        WHEN 'BACK'.
          LEAVE PROGRAM.
        WHEN <fcode for submit>.
          SELECT SINGLE uname pwd
           FROM <DB table>
           INTO (user, pass)
           WHERE username = user AND
                   password = passwd.
          IF sy-subrc = 0.
    <Go to next screen for further processing>
          ELSE.
    <Display Error message and exit>
          ENDIF.
      ENDCASE.
    Regards,
    Amit
    Message was edited by:
            Amit Kumar

  • How to set username and password for a tcode ?

    Dear Gurus,
              Greets..................
    Pls provide me solution for my scenario. My program is module pool program.It has been assigned by a Tcode.when the end user enter the tcode in command box,I should display a small screen with username and password(****).If username and password is correct,it should allow the end user to execute that particular tcode.If not i should display warning message that he is not eligible to access that program.
    Thanks & Regards.
    Raj

    Hi Raj,
    You can do this by creating a Login screen for the users and check the authentication of each user in PAI i.e. PROCESS AFTER INPUT.
    Store the user information in a database table and check the username and password when the user enters it.
    You can display password as *** also. For this double click on input box designed for password and goto Display tab. Select Invisible in the list and check it.
      CASE sy-ucomm.
        WHEN 'BACK'.
          LEAVE PROGRAM.
        WHEN <fcode for submit>.
          SELECT SINGLE uname pwd
           FROM <DB table>
           INTO (user, pass)
           WHERE username = user AND
                   password = passwd.
          IF sy-subrc = 0.
    <Go to next screen for further processing>
          ELSE.
    <Display Error message and exit>
          ENDIF.
      ENDCASE.
    Regards,
    Amit
    Message was edited by:
            Amit Kumar

  • Database Access delays-how to improve upon that?

    Hi friends,
    I have this simple class,which takes in query and returns the results.I don't know why the database access is so slow,and if i try to add my driver load statements into the constructor the java class starts throwing "null pointer exception"(Java Class code given below)..I don't know much about connection pool,can u just have a look at this simple class,and tell me if there's anything on which i can improve upon and where to add the(*.close() statements).The same query runs instantly if i make a php program.Urgent help needed...please help me guys.
    public class getResultSet{  private Connection con = null;  private Statement st = null;  private String dsn = "jdbc    b2j:net:xxx";  private String uname = "xxx";  private String pwd = "xxx";  private String query = "";  ResultSet results;   public void ResultS()throws Exception{      try{          Class.forName("com.ibm.db2.jcc.DB2Driver");          con = DriverManager.getConnection(dsn, uname, pwd);          st = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,                                   ResultSet.CONCUR_READ_ONLY);         }      catch (SQLException e) {          e.printStackTrace();          }     }     public ResultSet getResults(String query){            results = null;            try{               results = st.executeQuery(query);               }               catch(SQLException sqle){                 sqle.printStackTrace();               }            return results;     }   }

    Some comments on the code
    public class getResultSet{ // Class names should start with a capital letter and be nouns
    private Connection con = null;
    private Statement st = null; // Statements are transient and should probably not be a member variable
    private String dsn = "jdbc    b2j:net:xxx";  // dsn, user, pass should be final
    private String uname = "xxx"; 
    private String pwd = "xxx"; 
    private String query = "";  // Seems you're not using this
    ResultSet results;   // This really shouldn't be declared here
    public void ResultS()throws Exception{ // Method should start with a lower-case letter and be a verb/* The client code is supposed to call this, then the other method?
    Very fragile. I'm guessing NullPointerExceptions occur if ResultS
    is not called first. Have the other method call this one as necessary.
    try{        
    Class.forName("com.ibm.db2.jcc.DB2Driver");
    con = DriverManager.getConnection(dsn, uname,
    uname, pwd);
    st =
    st =
    =
    con.createStatementResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_READ_ONLY);
    ultSet.CONCUR_READ_ONLY);
    catch (SQLException e) {  
    e.printStackTrace();
    public ResultSet getResults(String query){      
    results = null;
    try{          
    results = st.executeQuery(query);
    catch(SQLException sqle){   
    sqle.printStackTrace();
    return results; // It's a bad idea to return ResultSets as that leaves resources open
    } // Where's the cleanup? You're leaving ResultSet, Statement, Connection open
    >It is probably slow because opening connections takes a long time. You may or may not need a connection pool depending on your app. Perhaps you can just open a connection at the beginning and leave it open until your app finishes. That should reduce the overhead and still be very simple.

  • Problem while connecting to DB2 through JDBC...Help PLZZZZZZZZZZZ

    Hi Everyone, I am facing this exception when I try to connect to DB2 to which installed on Z/OS. Please help me
    for your ref I am pasting my code below exception
    com.ibm.db2.jcc.b.SqlException: IO Exception opening socket to server 10.108.45.151 on port 446. The DB2 Server may be down.
         at com.ibm.db2.jcc.a.a.<init>(a.java:137)
         at com.ibm.db2.jcc.a.b.a(b.java:1542)
         at com.ibm.db2.jcc.b.o.<init>(o.java:795)
         at com.ibm.db2.jcc.a.b.<init>(b.java:298)
         at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:162)
    my code is:--
              try {
                   Class.forName("com.ibm.db2.jcc.DB2Driver");
              } catch (ClassNotFoundException se) {
                   se.printStackTrace();
                   System.out.println(se);
              try {
                        cn =DriverManager.getConnection("jdbc:db2://11.112.41.12:446/dbname","uname","pwd");
              } catch (Exception e) {
                   e.printStackTrace();
              }

    You will need to check this error message on metalink and likely on an SR.
    But with RAC you should not be connecting to the database, or in most cases, to a specific instance: You should be connecting to a TAF (or FCF) service.

  • 3850 WLC Admin GUI Authentiaction with AAA

    Hi all.  I'm making myself a little nutty this morning.  I've had a 3850 with the WLC function enabled in my lab for quite some time.  Just bumped it to 03.07.00E and I'm having a devil of a time getting in to the Wireless GUI - particularly when I have 'ip http authentication aaa' enabled.  I can still access the wired gui using my AAA setup just fine.
    Up until going to 3.07, I could get in to the wired or wireless GUI using AAA with no issues.
    So I know it's something in my aaa setup that needs to be tweaked - either on the switch side or somewhere inside my ACS setup.   Anyone run in to this yet?  And if so, any pointers?
    Thanks!

    Hi Viten,
    You're right - this isn't related to my problem.  And we've successfully done 'split' authentication where CLI uses AAA and Web uses local.  But it's a little cumbersome to set up, and sort of silly to do when there's a centralized AAA system available.
    Prior to 3.07, centralized AAA authentication for CLI and Web (for both the switch GUI and the wireless GUI) worked as expected for us.
    3.07 has introduced a 'Prime' style web page, with a 'Domain' choice for wireless or wired.  Choosing Wired as the domain causes the device to ask for a traditional Level 15 account, (as an extra set of prompts outside the 'Prime' style uname/password window) and after entering proper AAA credentials, you get the switch configuration GUI as expected.
    However, when you chose Wireless as the Domain, you can only enter a uname/pwd in the 'Prime' style authentication window.  Using the same AAA credentials as always, the device generates an authentication failure due to bad username/password.  An error in the python wnweb process is also generated in the switch logs.
    I've looked at my ACS logs - username/pwd is fine, and authentication is passing as expected in the ACS system.  The switch doesn't seem to be processing the returned TACACS+ authentication info correctly.

  • PASSWORD SYNC WITH AD

    Hi All,
    Please Help Regarding This Issue
    I Cannot Resolve password sync with this AD
    My Idm Version Is 9.1
    My Active Directory Running on Windows 2003
    =========================================================================================
    My AD SYNC LOG
    15 Sep 2008 19:05:51 INFO Logger created
    15 Sep 2008 19:05:51 INFO Triggering Password Synchronization mechanism
    15 Sep 2008 19:05:52 INFO Value of the installedFlag=>true
    15 Sep 2008 19:05:52 INFO Password Reset Installed..get the ITResourceType and ITResourceName
    15 Sep 2008 19:05:52 INFO IT ResourceType Name=> AD Server
    15 Sep 2008 19:05:52 INFO ITResourceName=> ADITResource
    15 Sep 2008 19:05:52 INFO Checking for OIM Server to synchronize password for the user--> IDMUSER
    15 Sep 2008 19:05:52 INFO Port: 1099
    15 Sep 2008 19:05:52 INFO Host: idmkuneh
    15 Sep 2008 19:06:04 INFO OIM Server is up and running !!
    15 Sep 2008 19:06:04 INFO Logging to OIM server
    15 Sep 2008 19:06:04 INFO Logging into OIM Server with an auth mechanism
    15 Sep 2008 19:06:04 INFO Necessary Configurations read
    15 Sep 2008 19:06:04 INFO Logging into OIM Server with uname/pwd based auth
    15 Sep 2008 19:06:04 INFO Finally !!
    15 Sep 2008 19:06:04 INFO Before System.exit(0):
    =========================================================================================
    MY XLCONFIG.XML
    - <xl-configuration>
    <appServerName>jboss</appServerName>
    - <Discovery>
    - <CoreServer>
    <java.naming.provider.url>jnp://idmkuneh:1099</java.naming.provider.url>
    <java.naming.factory.initial>org.jnp.interfaces.NamingContextFactory</java.naming.factory.initial>
    </CoreServer>
    </Discovery>
    - <Security>
    - <XLSymmetricProvider>
    - <KeyStore>
    <Provider>com.sun.crypto.provider.SunJCE</Provider>
    </KeyStore>
    </XLSymmetricProvider>
    - <XLPKIProvider>
    - <KeyStore>
    <Location>.xlkeystore</Location>
    <Password encrypted="true">FlbwcjDZAB0hS3Q8F7PB4g==</Password>
    <Type>JKS</Type>
    <Provider>sun.security.provider.Sun</Provider>
    </KeyStore>
    - <Keys>
    - <PrivateKey>
    <Alias>xell</Alias>
    <Password encrypted="true">FlbwcjDZAB0hS3Q8F7PB4g==</Password>
    </PrivateKey>
    </Keys>
    <SignatureAlgorithm>SHA1withDSA</SignatureAlgorithm>
    <SignatureProvider>sun.security.provider.Sun</SignatureProvider>
    <VerifySigner>false</VerifySigner>
    </XLPKIProvider>
    </Security>
    - <!-- Configuration for AD Password Sync Adapter
    -->
    - <ADSync>
    - <Login>
    <UseSignature>false</UseSignature>
    <Username>xelsysadm</Username>
    <Password encrypted="true">aPM3F6YImvbctkGkE4C4Ww==</Password>
    </Login>
    - <UserMatch>
    - <!-- UserID and UDF
    -->
    <MatchingMethod>UserID</MatchingMethod>
    <FieldName>UD_ADUSER_LOGIN</FieldName>
    <ResourceObject>AD User</ResourceObject>
    </UserMatch>
    - <Result>
    <UpdateUDF>false</UpdateUDF>
    <FieldName>USR_UDF_ADPWDRES</FieldName>
    <SuccessValue>SUCCESS</SuccessValue>
    <FailureValue>FAIL</FailureValue>
    <AppendTimeStamp>true</AppendTimeStamp>
    </Result>
    - <ADConnectorConfig>
    <Installed>true</Installed>
    <ITResourceType>AD Server</ITResourceType>
    <ITResourceName>ADITResource</ITResourceName>
    </ADConnectorConfig>
    </ADSync>
    - <Cache>
    - <XLCacheProvider>
    <MultiCastAddress>10.10.10.30</MultiCastAddress>
    </XLCacheProvider>
    </Cache>
    </xl-configuration>
    =========================================================================================
    Thanks Before
    Gde

    Which version of AD Connector and AD Pass Sync Agent are you using?
    I think the Filed Name is now UD_ADUSER_UID.
    Did you complete all the post installation steps of Password Sync Agent?

Maybe you are looking for

  • Save opt missing in message as is need to save blu...

    I am faceing problem in saving recd bluetoot files,I even pressed the recd file & held 4 4sec but there is no opt 2 save..plz advice

  • How to set default path for file open in SQL Developer

    Hi, I am new to Oracle SQL Developer. Everytime when I open a file, it will default to the install directory. It is hurtingmy hand because I have to click back to the folder where I put my sql statements. Is there any way to set the Home or Work butt

  • Add audio from 25 fps video to 23.976 fps

    Hello, I want to add audio file from 25 fps to match with another video with 23.976 fps using Audition. How can i do that ?! 25 fps video settings: General Complete name                            : 01.avi Format                                   : A

  • Run a subvi by pressing a button multiple times

    Hi I wanted to run a subvi each time the user pushes a button. So the subvi might be called multiple times & different instances of the subvi run simultanously with their front panels open. To do this I made a .vit & call it by refrence wehenever a b

  • Connecting new laptop to DSL

    I have a desktop that is currently connected directly to DSL.  I now have a new laptop that I want to connect to the same DSL as well.  I plan on eventually buying a router to connect both the desktop (direct connection) and the laptop (wireless) to