Skip to Content
author's profile photo Former Member
Former Member

Authenticate user from web service


I am trying to create content in KM using a web service but all I get is a "com.sapportals.wcm.repository.AccessDeniedException: User <myuser> is not authenticated" error.

I have been able to create folders in KM with my web service using a service user (cmadmin_service) but I would like to do it with any user. (Actually I don't know why service users work)

This is my method to create folders:

	public String createFolder(String parentRID, String folderName, String user) { iUser = null;
		String respuesta = null;		

		RID rid = RID.getRID(parentRID);

		try {

			iUser = WPUMFactory.getUserFactory().getUser(user);
			IResourceFactory factory = ResourceFactory.getInstance();
			IResourceContext context = new ResourceContext(iUser);
			ICollection parent = (ICollection)factory.getResource(rid, context);
			ICollection collection = parent.createCollection(folderName, null);
			respuesta = collection.getName();
		catch(Exception e){
			respuesta = e.toString();
		return respuesta;

How can I get "myuser" authenticated?

I hope you may help me, Thanks!

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.