WEBSERVICE authorization in URL

WEBSERVICE function doesn’t forward urls in form: http://[user]:[port]@[server]:[port]/[endpoint] to destination server.

If I ommit [user]:[port]@ libreoffice WEBSERVICE function opens url.

Allowing calling urls in form:
http://[user]:[port]@[server]:[port]/[endpoint]

would allow us to add authorization to urls, since there is no way to specify http headers in WEBSERVICE call.

I also opened bug for this topic bug on bugzilla

See answer there on the bug and why it won’t be implemented.

Btw, you meant to write [user]:[password]@

Did you have a look here ?

I checked code in the example you mention - but I don’t see where InteractionHandler_handle is used.
InteractionHandler_handle is only sub where user and password is set but sadly it isn’t used anywhere.

Call it from XInteractionHandle_handle, i.e.

Function XInteractionHandle_handle(oRequest)
	InteractionHandler_handle(oRequest)
End Function

Btw the exemple is for a post request, a get would be something like this

  oUCB = CreateUnoService("com.sun.star.ucb.UniversalContentBroker")
  oId = oUCB.createContentIdentifier(sURL)
  oContent = oUCB.queryContent(oId)

  oDataSink = CreateUnoListener("XDataSink_", "com.sun.star.io.XActiveDataSink")
  oCommandEnv = CreateUnoListener("XCommandEnv_", "com.sun.star.ucb.CommandEnvironment")
  
  oGetArgs = CreateUnoStruct("com.sun.star.ucb.OpenCommandArgument2")
  oGetArgs.Mode = 2 
  oGetArgs.Sink = oDataSink
  
  aCommand = CreateUnoStruct("com.sun.star.ucb.Command")
  aCommand.Name = "open"
  
  oContent.execute(aCommand, 0, oCommandEnv)

  oOutput = oDataSink.getInputStream()

[erAck: edited to format as code, see This is the guide - How to use the Ask site? - #6 by erAck ]