Application Development 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: 

throwUserLoginException / throwNewLoginException

Former Member
0 Kudos

Hi all,

We've written a custom login module, with some checks built in to determine if a user is allowed to logon (example if his current domain is included in a list of valid domains that are allowed to logon to the portal). The loginmodule works fine, but we want to give the users some usefull message regarding the reasen access is denied.

The class we use extends <a href="https://media.sdn.sap.com/javadocs/NW04/SPS15/en/com/sap/engine/interfaces/security/auth/AbstractLoginModule.html#throwNewLoginException(java.lang.String)">AbstractLoginModule</a>, which has some methods like

throwUserLoginException(Exception exception, byte cause) and throwUserLoginException(Exception exception)

Below a snippet of the code :


throwNewLoginException("current domain not contained in list of allowed domains", LoginExceptionDetails.USER_IS_CURRENTLY_NOT_VALID) ;

Also tried :


throwUserLoginException(new Exception ("current domain not contained in list of allowed domains"), (byte) 2) ;

All the user gets to see in the login screen when the logon is being denied is " Unknown message (ID = UNKNOWN_ERROR) ". How can we pass usefull info to the end- users?

Many thanks,

Kevin

3 REPLIES 3

Former Member
0 Kudos

Hi Kevin,

i'm currently facing the same problem. Do you have a solution for this?

Former Member
0 Kudos

Sorry for bringing up such an old thread, but how did you solve your problem?

Former Member
0 Kudos

Hi,

This message is already pretty old but we're currently facing the same problem.
We are not able to show the user the corresponding error message.
Any idea how to solve this?

In the log files we see the corresponding messages.

Thanks,

Thomas