Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Web Service Authentication

Former Member
0 Likes
1,494

Hi,

I am trying to authenticate from Flex. I have attached the credentials to the WSDL (i.e. ?wsdl=1.1&sap-user=<username>&sap-password=<password>) and I have also tried using the setRemoteCredentials() and setCredentials methods. None of them are authenticating as I still recieve a popup box asking for credentials or a Stream Error. Below is a snippet of what I have.

service.wsdl ="http://abcde:8000/sap/bc/srt/rfc/sap/z_ws_service?wsdl=1.1&sap-user="userName"sap-password="+password;

service.ZDpGetUserInfo.resultFormat="e4x";

service.addEventListener(LoadEvent.LOAD, userInfoLoad);

service.addEventListener(ResultEvent.RESULT, userInfoResult);

service.addEventListener(FaultEvent.FAULT, faultHandler);

service.loadWSDL();

also does not work with...

service.wsdl ="http://abcde:8000/sap/bc/srt/rfc/sap/z_ws_service?wsdl=1.1";

service.setRemoteCredentials(userName, password);

any ideas? If I set a service account as the user in "Logon Data" in the Maintain Service (sicf) transaction, it works fine, but I want users to authenticate individually and not use the service account.

Hi,

I am trying to authenticate from Flex. I have attached the credentials to the WSDL (i.e. ?wsdl=1.1&sap-user=<username>&sap-password=<password>) and I have also tried using the setRemoteCredentials() and setCredentials methods. None of them are authenticating as I still recieve a popup box asking for credentials or a Stream Error. Below is a snippet of what I have.

service.wsdl ="http://abcde:8000/sap/bc/srt/rfc/sap/z_ws_service?wsdl=1.1&sap-user="userName"sap-password="+password;

service.ZDpGetUserInfo.resultFormat="e4x";

service.addEventListener(LoadEvent.LOAD, userInfoLoad);

service.addEventListener(ResultEvent.RESULT, userInfoResult);

service.addEventListener(FaultEvent.FAULT, faultHandler);

service.loadWSDL();

also does not work with...

service.wsdl ="http://abcde:8000/sap/bc/srt/rfc/sap/z_ws_service?wsdl=1.1";

service.setRemoteCredentials(userName, password);

any ideas? If I set a service account as the user in "Logon Data" in the Maintain Service (sicf) transaction, it works fine, but I want users to authenticate individually and not use the service account.

11 REPLIES 11
Read only

athavanraja
Active Contributor
0 Likes
1,391

may be because you havent mentioned the sap-client in the url, its going to a default client and the password you are providing is for a different client

Raja

Read only

0 Likes
1,391

When specifying the client in the URL, I have the same issues.

Read only

0 Likes
1,391

in sicf , is the logon data required check box is checked?

(ps: i currently do not have access to system, but can check it up and let you know tomorrow)

Message was edited by:

Durairaj Athavan Raja

Read only

0 Likes
1,391

Yes.

Read only

0 Likes
1,391

just check the check box "All Logons" and try it should take the uid/pwd passed thru url and should not prompt for authentication.

Raja

Read only

0 Likes
1,391

In ECC6, in the "Create/Change" service area inside "Maintain Service" (sicf), there are no check boxes named "All Logins". In the logon data tab, the closest thing would be the "Procedure" drop down which contains "Required with Logon Data" (tried), "Alternative Logon Procedure", "Required With Client Certificate (SSL), and "Standard Procedure" (tried).

Read only

0 Likes
1,391

sorry about the delay. in my case i am using a standard login and i dont have the problem you have.

I am trying to simulate your case, if successful, will post the results here.

Raja

Read only

0 Likes
1,391

Raja,

Thanks for the help, I appreciate it.

Read only

0 Likes
1,391

may be FQDN is the problem.

try setting up the Fully Qualified Domain Name for you server and check again.

more on FQDN

https://wiki.sdn.sap.com/wiki/display/BSP/FullyQualifiedDomainName%28FQDN%29

Read only

0 Likes
1,391

I've been using a fully qualified domain name.

Read only

former_member10945
Contributor
0 Likes
1,391

Dennis -

I got the authentication stuff to work easily using the sap-username on the end of the WSDL. I think the syntax you are using is wrong in your example:

?wsdl=1.1&sap-user="+userName+"sap-password="+password;

should be:

?wsdl=1.1&sap-user="+userName+"&sap-password="+password;

That worked for me. The set[Remote]Credentials methods have nothing to do with what you are trying, they are for LiveCycle Data services. There is another more secure way to do this which is to base-64 encode the username and password and add it to the header of the HTTP request but, that is a bit cumbersome as if the U/P is wrong there is no easy way to notify the user.

I never do it the way you are showing here though, I simply put the SWF in the Mime repository and make sure you need a u/p to access it. When the user does their normal login thing their browser will get the MYSAPSSO2 ticket allowing them to use any webservices you have SSO configured for. This way is much cleaner and you don't have to worry about authorization in your Flex app that is consuming WebServices the browser handles it for you.