Quantcast
Channel: SCN : Discussion List - SAP HANA Cloud Platform Developer Center
Viewing all articles
Browse latest Browse all 3131

Validate if a userid exists (com.sap.security.um.user.UserProvider)

$
0
0

Hi folks,

 

I'm trying to implement a Java Service in order to validate user ids. The problem is that the UserProvider is not working as expected. Here is the code:

public boolean isUserNameValid(String userName) throws WebServiceException {    User user = null;    Set<String> users;    try {      if (userProvider == null) {        userProvider = UserManagementAccessor.getUserProvider();      }
 // ALWAYS returns a User eventhough the API docs say "Returns the user which has the provided name, or nu      user = userProvider.getUser(userName);      // ALWAYS returns 'true' no matter if the user id exists on the HCP account or not 
 boolean isValid = user.isValid(Calendar.getInstance());
// NEVER returns users eventhough I pass an exact userName that exists      users = userProvider.searchUser(UserAttribute.NAME, userName, UserProvider.SearchOperator.EQUALS, UserProvider.CaseSensitive.NO);    } catch (PersistenceException | IllegalStateException e) {      throw new WebServiceException("An unknown error occured");    }    return user != null;  }

For whatever userId I request a user with the getUser function I get a User returned. And even worse this User object always looks precisely the same only differing in the user name which is the one I passed...

 

This way I see absolutely no way to validate if a user id is valid...

 

Is there some configuration or security implications I oversee?!

 

BR

Christian


Viewing all articles
Browse latest Browse all 3131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>