| Author |
Share Topic Topic Search Topic Options
|
rclarke
Groupie
Joined: 14-Jun-2007
Location: United States
Posts: 69
|
Post Options
Quote Reply
Topic: Login and SessionBundle Posted: 12-Nov-2008 at 1:00pm |
Bingo! I had the probeAssembly in the wrong place, it was in the EdmKeys. I saw the existing probe elements for my Entity model and Domain Model and just added it there because in Classic it was in the rdbKey. Thanks for your help, I would never have found it on my own. But then, I don't recall seeing this documented anywhere. Did I overlook it?
Ron
|
 |
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 12-Nov-2008 at 9:48am |
Double check the following -
- Your class should implement the IEntityLoginManager interface (was IPersistenceLoginManager in Classic).
- The Login method should have this signature:
IPrincipal Login(ILoginCredential pCredential, EntityManager pManager);
- Reference IdeaBlade.EntityModel.v4 in the project containing this Login class.
- Add the assembly name to the top-level probe assembly names in config; probing for this interface does not look at the EdmKeys or RdbKeys:
<ideaBlade.v4 version="4.00" ..... > <probeAssemblyNames> <probeAssemblyName name="MyServerLib" /> </probeAssemblyNames> </ideaBlade.v4>
-
Make sure this assembly is in the folder where the executable is located.
-
Check the debug log. If your IEntityLoginManager was found a trace message will be written.
-
Also make sure you have only one implementation of IEntityLoginManager. If by some strange turn of events more than one is found in the probe assemblies, we'll actually ignore them all :).
|
 |
rclarke
Groupie
Joined: 14-Jun-2007
Location: United States
Posts: 69
|
Post Options
Quote Reply
Posted: 12-Nov-2008 at 7:37am |
Kim,
Well, I know what was adding to my confusion. The project I'm trying to convert to EF borrowed heavily from the security learning unit you provide with Classic. Since the only thing I changed in my code was the Ideablade references and the code which expected a SessionBundle to be returned, I assumed (I know, I shoud know better) that my custon Login Manager would be called; it is not. So, I checked the AppHelper App.config file and added a probeAssemblyName for the assembly which contaiins my custom Login Manager. Still nothing. I have checked to make sure that the Ideablade References are correct so right now I'm stumped. I'm not ready to say this is your problem yet, I still want to make sure it is not something I've overlooked. If you have any suggestions, I would appreciate it.
Ron
|
 |
rclarke
Groupie
Joined: 14-Jun-2007
Location: United States
Posts: 69
|
Post Options
Quote Reply
Posted: 11-Nov-2008 at 4:51pm |
|
Thank you for the clarification.
|
 |
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 11-Nov-2008 at 3:59pm |
There is no IdeaBlade IIdentity in Classic, we've always used the System.Security.Principal.IIdentity, and System.Security.Principal.IPrincipal, interfaces.
The Login method returns - via the SessionBundle in DevForce Classic or the Thread.CurrentPrincipal in both versions - the concrete Principal type returned by your LoginManager implementation. If you don't implement a LoginManager, then a GenericPrincipal, containing a GenericIdentity, is returned.
|
 |
rclarke
Groupie
Joined: 14-Jun-2007
Location: United States
Posts: 69
|
Post Options
Quote Reply
Posted: 11-Nov-2008 at 2:51pm |
Kim,
Thanks, but I'm still a bit unclear as to how this works in EF compared to Classic. If I get the Identity as you suggest, it reflects that it is of the type GenericEntity. Classic sets the Identity in the sessionbundle to the Ideablade IIdentity. Can the type of Identity be ignored in EF?
Ron
|
 |
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 11-Nov-2008 at 1:28pm |
After Login is called, the Thread.CurrentPrincipal is set to the IPrincipal from the SessionBundle. You can access this in your code like so:
Dim identity = System.Threading.Thread.CurrentPrincipal.Identity
Thanks for the heads up on the documentation - we'll get that fixed.
|
 |
rclarke
Groupie
Joined: 14-Jun-2007
Location: United States
Posts: 69
|
Post Options
Quote Reply
Posted: 11-Nov-2008 at 10:30am |
|
The EntityManager.Login method now returns a boolean instead of a SessionBundle. So, how can I get access to the Identity created by the login? In Classic this was available through SessionBundle. The EF Developer's guide still indicates that Login returns a SessionBundle as does some of the Help document.
|
 |