Search code examples
javaauthenticationsingle-sign-onjco

Authenticate without entering userid and password


In our organization we have an internal portal like www.xyz.com and we use SAP Web interface.

Basically I'm writing a Java code using JCo to fetch the data from SAP table. but I need to authenticate to get into the application. In this Web interface we don't enter the user name and password.

When I open the Web page it directly takes the USERID and PASSWORD from xyz.com portal and logs in.

Is there a way that in my Java code, I can retrieve that data (I don't want to view it, just authenticate directly using that portal) and get the data. Currently my code to retrieve data is like below.

JCO.createClient("SAP client", "username","password","language",
"server name","system number");

Here I want to get the user name and password directly.

Is there a way to get this?

Thanks


Solution

  • It sounds that your portal is using a SSO solution?

    In general it is possible by using JAAS.

    Configure a JAAS LoginModule, get the username and - maybe - the password and providing that information to the JCO client.