0

I have some functional id to mailbox.

I need to connect to this mailbox via domino agent.(So I need to create session with functional id rights) But when I'm trying to create session object with NotesFactory.createSession("", username, password); I have an exception:

Cannot create a session from an agent

So if anybody know how can I do it I'll be appriciate.

Advices that you need to configure certificates between two servers won't help me.

Alexander
  • 45
  • 6
  • Also when I'm trying to get session via DIIOP I have an exception Could not get IOR from Domino Server. So as far as I understand this is a mission impossible – Alexander Sep 14 '17 at 13:03

1 Answers1

0

You cannot change the identity of a Java agent that way. An agent can only use

NotesFactory.createSession(); // no arguments

If it is a web agent that runs in response to a URL (either as a webqueryopen or webquerysave agent, or through the ?OpenAgent URL command), and you set Run as Web User in the agent properties, then the session will be created using the identity of the authenticated web user.

As for the DIIOP case, it sounds like your server is not configured properly for IIOP access. Check out this IBM Technote that describes the settings. (Pay no attention to the references to WebSphere in the TechNote. The problem would affect any IIOP client. The solution is to fix the server settings.)

Richard Schwartz
  • 14,463
  • 2
  • 23
  • 41
  • The goal to get access to verse mailbox. As far as I understand when lotus mailbox moved to cloud, you can get access only via notes client. – Alexander Sep 15 '17 at 09:44
  • If you really need to use the Notes client, and you really need to have your code run with the identity of a specific ID, then you're going to have to switch the Notes client's current ID to the one that you need and use createSession() with no arguments. – Richard Schwartz Sep 15 '17 at 15:19
  • No, I need to run this on server, but with functional id rights. – Alexander Sep 18 '17 at 09:55
  • You can set up two agents. One is a web agent using the Run as Web User property. The second is an ordinary Java agent that uses URLConnection to invoke the web agent - sending the user login and password info. See the second answer to this question for sample code: https://stackoverflow.com/questions/496651/connecting-to-remote-url-which-requires-authentication-using-java Note that this assumes that the HTTP task is enabled on the Domino server, and that Basic authentication is allowed. It's more complex if you have to do session authentication, and impossible without HTTP enabled. – Richard Schwartz Sep 18 '17 at 13:37