This Space has blogs on various topics in the field of SAP. These blogs point out solutions to various technical and functional issues that consultants face during implementation or support of SAP Projects. Readers/followers are welcome to contribute to this space by emailing your content at bohra.mohammadi@gmail.com. You will be rewarded according to the topic/number of words/complexity of the topic/issue which are you addressing in your blog.
Wednesday, May 17
Logon to SAP EP Programatically by using UMFactory's LogonAuthenticator.Logon
@ NIIT Technologies, Marwah Centre, Mumbai
I am trying to write a java program which logs on a user to SAP EP with a user and password provided to the program. Some literature about it is available on the internet but no luck since couple of days. People are talking about using UMFactory's LogonAuthenticator.Logon method to log the user in. I tried it with various authentication schemes like basicauthentication, uidpwdlogon, certlogon etc but failed every time unfortunately. There are no error logs getting generated in the stack traces of server to guide me further towards solution.
Logon by posting j_user and j_password to EP URL.
I am alternatively posting j_user and j_password variables to EP URL to log the user on. It works. See below form for reference.
For the former method, I am could see that in authentication of EP in nwa, below message about authentication policies is being displayed. I beleive, the warning being displayed in causing the problem
The message is 'There are conflicting policy configurations: [anonymous,default,certlogon,uidpwdlogon,UserAdminScheme,basicauthentication]'
My Source code the for the former approach
request.setAttribute(ILoginConstants.LOGON_UID_ALIAS,"useridtest");
request.setAttribute(ILoginConstants.LOGON_PWD_ALIAS,"passwordtest");
try
{
UMFactory.getLogonAuthenticator().logon(request, response, "uidpwdlogon");
}
catch(javax.security.auth.login.LoginException e)
{
out.println (e.getStackTrace());
}
Result printed on screen from stack Trace[Ljava.lang.StackTraceElement;@35ab660e
All suggestions to above problem are welcome.
I am trying to write a java program which logs on a user to SAP EP with a user and password provided to the program. Some literature about it is available on the internet but no luck since couple of days. People are talking about using UMFactory's LogonAuthenticator.Logon method to log the user in. I tried it with various authentication schemes like basicauthentication, uidpwdlogon, certlogon etc but failed every time unfortunately. There are no error logs getting generated in the stack traces of server to guide me further towards solution.
Logon by posting j_user and j_password to EP URL.
I am alternatively posting j_user and j_password variables to EP URL to log the user on. It works. See below form for reference.
For the former method, I am could see that in authentication of EP in nwa, below message about authentication policies is being displayed. I beleive, the warning being displayed in causing the problem
The message is 'There are conflicting policy configurations: [anonymous,default,certlogon,uidpwdlogon,UserAdminScheme,basicauthentication]'
My Source code the for the former approach
request.setAttribute(ILoginConstants.LOGON_UID_ALIAS,"useridtest");
request.setAttribute(ILoginConstants.LOGON_PWD_ALIAS,"passwordtest");
try
{
UMFactory.getLogonAuthenticator().logon(request, response, "uidpwdlogon");
}
catch(javax.security.auth.login.LoginException e)
{
out.println (e.getStackTrace());
}
Result printed on screen from stack Trace[Ljava.lang.StackTraceElement;@35ab660e
All suggestions to above problem are welcome.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
You are welcome to express your views here...