Book a Demo

Author Topic: OpenFile2 connects with single signon user  (Read 7007 times)

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
OpenFile2 connects with single signon user
« on: September 26, 2008, 10:41:06 pm »
Just filed this bug...

When Windows authentication is turned on the OpenFile2 method connects to the repository with the current Windows logon regardless what is given in the username and password string.

Reproduce:

Connect to repository:
eaRepository.OpenFile2(CONNECTIONSTRING,"admin","xxx"));

Get an arbitrary package and apply user lock:
pck.ApplyUserLock();

Open EA and look in the project browser for the package in question: Not the user "admin" given but the windows user has applied the user lock.

Oliver

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: OpenFile2 connects with single signon user
« Reply #1 on: September 27, 2008, 03:30:16 am »
What happens if you run EA as another user (for example, but shift-right clicking or control-right clicking the EA icon and using the context menu)?
No, you can't have it!

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: OpenFile2 connects with single signon user
« Reply #2 on: September 29, 2008, 06:45:49 pm »
Quote
What happens if you run EA as another user (for example, but shift-right clicking or control-right clicking the EA icon and using the context menu)?

Sorry, I did not mention that I was accessing EA from an external program, not from and addin within.
So EA is not running when ApplyUserLock is called.

I had to additionally call ChangeLoginUser() to get the right login user.

Oliver

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: OpenFile2 connects with single signon user
« Reply #3 on: September 29, 2008, 10:07:42 pm »
I take it you mean you had to run the EA use change. [I think] That would make sense if Windows authentication were turned on. By default, Windows authentication does not ask for credentials, and when it does, it assumes your login ID as the default (if any). I suspect that EA is merely acting in parallel with that; if you don't explicitly give EA a 'new' ID it presents no credentials to the database, which uses your Windows login credentials to authenticate the connection.
No, you can't have it!

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: OpenFile2 connects with single signon user
« Reply #4 on: September 30, 2008, 01:01:47 am »
Quote
I take it you mean you had to run the EA use change. [I think] That would make sense if Windows authentication were turned on. By default, Windows authentication does not ask for credentials, and when it does, it assumes your login ID as the default (if any). I suspect that EA is merely acting in parallel with that; if you don't explicitly give EA a 'new' ID it presents no credentials to the database, which uses your Windows login credentials to authenticate the connection.

If it were like this it would render the OpenFile2 method useless if Windows authentication was turned on because it would not consider the given user/password combo at all. I would have to apply the ChangeLoginUser method then anyway.

Oliver

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: OpenFile2 connects with single signon user
« Reply #5 on: September 30, 2008, 03:20:58 am »
And perhaps that's how it works. But remember, when I said "I suppose..." I was making a guess.

Remember that as long as you've got Windows security set for your DBMS there is little EA can do about this unless you tell EA which credentials to use.

Of course, you could always set up a connection string to force SQL Server to pop up a login dialog, but you still have the same issue of having to supply credentials. Worse for some applications, you would also have to supply a user to type them in.
No, you can't have it!

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: OpenFile2 connects with single signon user
« Reply #6 on: September 30, 2008, 04:54:04 pm »
Quote
And perhaps that's how it works. But remember, when I said "I suppose..." I was making a guess.

I noticed this, of course ;)

Quote
Remember that as long as you've got Windows security set for your DBMS there is little EA can do about this unless you tell EA which credentials to use.

Well, it would be worth having an explanation from Sparx why there is an OpenFile method, an OpenFile2 methode (to give credentials) and a method to sperately define those credentials.
I would expect that OpenFile2 would call OpenFile and then at least change the user name. Obviously it does not.

Currently it exceeds my understanding so I am wondering where the sense in this is.

Oliver

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: OpenFile2 connects with single signon user
« Reply #7 on: October 01, 2008, 10:28:23 pm »
Could be versatility. Could be legacy. Could be both.

Overall, I can live with the situation, and accept the finer granularity of control.

The SDK needs considerably more work across the board. One of the most glaring areas is the API grid. Many of the documentation fragments there are really difficult to fathom if you don't have the EA source code at hand. [And out here in the real world, none of us do.]

Sigh...
No, you can't have it!