on 12-14-2006 6:57 AM
Hi
Can anyone help me out to make a login() method that can be used to login to the SAP Netweaver server using a simple java code..........
Hope a helpfull answers from u all....
THANKS in ADV.
Rupesh Khemka
Hi Rupesh,
try to look at this links:
Hope this help
Francesco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Everyone
I have made the login() method but i am facing the problem while making the resource context...Because in Resource Context it takes IUser of package
com.sapportals.portal.security.usermanagement.IUser but I have got IUser of package com.sap.security.api.IUser ...while type Casting it with below code it is giving ClassCAstException.......
public class NewSimpleServlet extends HttpServlet {
protected void doGet(
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
StringBuffer s = new StringBuffer();
try {String j_user="epuser";
String j_password="Abcd1234";
request.setAttribute("j_user", j_user);
request.setAttribute("j_password", j_password);
javax.security.auth.Subject subject;
Set principals = UMFactory.getLogonAuthenticator().logon(request, response, "uidpwdlogon").getPrincipals();
i have problem with getting IUser object from set of principals. In javadoc is written: "In order to get an IUser object from this subject, call Subject.getPrincipals() and iterate through the returned Set of principals." so i tried to iterate but i was not able to get that IUser with any casting. Do u know how it should be?
IUser serviceUser = (IUser)subject.getPrincipals().iterator().next();
Now in resource Context
ResourceContext c = new ResourceContext(User);
Here resource context need IUser type object as parameter...
I also tried st like this
loggedUser = UMFactory.getAuthenticator().getLoggedInUser(request, response);
but loggedUser is not authenticated.
Can Anyone Help me Out...
Thanks
Rupesh Khemka
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You are looking for standalone Java that just makes a connection to the portal with the userid and password or else you are developing a web based front end??
-Rudhras
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Francesco,
I need to get the documents that resides in KM repository of SAP Netweaver...for that i should provide first the login() method that should connect to SAP Netweaver KM repository using user name & Password..
I have configured My SAP NW develo-per studio to my server ip address..But the method should use Username & password of the SAP user and check the authentication and then should give the required results.
I have used IUser interface & WPUMFactory as shown below
IUser serviceUser = WPUMFactory.getServiceUserFactory().getServiceUser("cmadmin_service");
And i am passing this serviceuser to ResourceContext
ResourceContext c = new ResourceContext(serviceUser);
This is my code PLZ Help me
Regards,
Rupesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rupesh,
witch is the component of netweaver you need to connect?
Regards
Francesco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Francesco Bersani ,
Thanks for ur response.The pdf files send by u have already been read by me but there i can't find any worthful result considering my criteria . I want a simple java class that can connect to SAP Netweaver using username & password.....
Any help in this respect will be highly appreciated
Regards,
Rupesh Khemka
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.