Print Page | Close Window

Security

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3663
Printed Date: 25-Oct-2025 at 11:09pm


Topic: Security
Posted By: orcities
Subject: Security
Date Posted: 25-Sep-2012 at 10:56am
When developing a WinRt app do I have to use the Asp.net type security or can I do windows type? I have tried n-tier with the server containing the IEntityLoginManager code and it is never called.

This may seem like an odd question but I am new to WinRt and have never done Win7 phone apps.



Replies:
Posted By: sbelini
Date Posted: 26-Sep-2012 at 12:02pm
Hi,
You can indeed use Windows authentication in a WinRt app. ( http://msdn.microsoft.com/en-us/library/hh556233%28v=vs.110%29.aspx - http://msdn.microsoft.com/en-us/library/hh556233(v=vs.110).aspx )
 
This appears to be a bug. We are investigating the issue and will keep you posted.
 
Regards,
   sbelini


Posted By: sbelini
Date Posted: 01-Oct-2012 at 3:29pm
Hi orcities,
 
I looked further and the LoginManager appears to be working properly.
While I can't hit a breakpoint, (like in SL or WPF) I know that the LoginManager is being hit because it writes to the debug log.
 
I'm attaching a simple solution showing it: uploads/892/T12169.zip - uploads/892/T12169.zip
 
Regards,
   sbelini.


Posted By: orcities
Date Posted: 02-Oct-2012 at 8:21am
In running your example. I had forced an error in the Login Manager. The data still loads successfully. This implies it is not working correctly.


Posted By: sbelini
Date Posted: 02-Oct-2012 at 10:17am

Note that my LoginManager does not do anything usefull other than write to the log to prove it's being hit.

 
I had not intention of writing a LoginManager that properly authenticates the user as this was not the issue. (You can see I'm just passing null credentials)
As a matter of fact, after the login, the user is still not authenticated.
 
Maybe I misunderstood your original question. I was under the impression that the issue is that the LoginManager was not being hit upon a LoginAsync call. - We already stablished that this is not the case.
 
Please explain in detail what it the problem you are experiencing.
 
Regards,
   sbelini.
 
 


Posted By: orcities
Date Posted: 02-Oct-2012 at 10:21am
The issue is of course the whole thing. Providing security. Not allowing anything if they do not have permission. I will apply the entity security layer and see if it does not provide results.


Posted By: orcities
Date Posted: 02-Oct-2012 at 11:19am
Attached please find my example. It does not fail at either the login or the entityqueryinterceptor.

https://skydrive.live.com/redir?resid=ECD10C8671EB34FD!673&authkey=!AImKwRK_7Weynjs - Example




Posted By: sbelini
Date Posted: 02-Oct-2012 at 1:11pm
orcities,

Your sample appears to be failing as it should.

It is always failing during Login, throwing a NotImplementedException (it never gets to the QueryInterceptor since login throws):



sbelini.


Posted By: orcities
Date Posted: 02-Oct-2012 at 1:18pm
When I run it it still give me results. If it fails to login it should not get results. It never throws the error.


Posted By: sbelini
Date Posted: 02-Oct-2012 at 2:05pm
Did you make sure to clean/rebuild the solution and close IIS Express?


Posted By: orcities
Date Posted: 02-Oct-2012 at 2:58pm
I have tried all including restarting machine. Nothing makes the error get thrown or stop the query from loading data.

I am sure if you altered the example to load from northwindib it would give you same results.


Posted By: sbelini
Date Posted: 03-Oct-2012 at 10:37am
I had actually created a db based on the model and added a few records when I tested. Still I get the exception thrown as shown in the screenshot.


Posted By: orcities
Date Posted: 03-Oct-2012 at 10:39am
You have my exact code. Can you help me figure out why I would be getting data when you are getting the error?


Posted By: orcities
Date Posted: 04-Oct-2012 at 7:29am
In looking further I see that the EntityManager is in fact not logged in. But, why does it still return data?


Posted By: orcities
Date Posted: 04-Oct-2012 at 7:57am
I added another entity to the edmx and now I get the error. Apparently just rebuilding the model didn't do it. I needed to alter it.

Thank you.




Posted By: sbelini
Date Posted: 04-Oct-2012 at 9:39am
Thanks for the update.
I'm glad the issue is gone. I was starting to run out of options here.
 
sbelini.



Print Page | Close Window