views:

33

answers:

2

I'm making a Windows Phone 7 app that has login/logout semantics (authenticating to a web app). When the user logs out I navigate back to the login screen and forget the session authentication.

When doing so I'd also like to clear the navigation history so that can't go back to a page that expects them to be already authenticated.

Can't see how to do it with NavigationService and am wondering if there is a way to do this.

A: 

I am afraid you cannot clear the stack of pages and what is more, your app will not pass the certification. More info

lukas
+2  A: 

Hi Dkackman,

There are a few things to look at here. First is I recommend familiarising with the guidance offered here.

Introducing the concept of “Places” - Peter Torr's Blog

Redirecting an initial navigation - Peter Torr's Blog (down at the moment sorry)

If you're able to work within this guidance that is the best path. There is specific advice for dealing with login screens.

If you are compelled to offer a home button feature. Be careful how you apply this, as certifiers are knocking apps back for behaving in unexpected ways with respect to navigation. I feel if this function is behind a home button you should be ok in the surprise department. How this stands over time with certification we will see. Arguably a "logout" scenario applies equally.

Here are three approaches from Richard Woo, Maarten Struys, Sam Jarawan.

Mick N
Thanks Mick. I look forward to readin that post when it comes back up. I am having trouble seeing how the very typical scenario of logging in and logging out, especially when authenticating against remote resources, fits into what I have been reading about windows phone navigation rules.
dkackman
There were two posts actually, I edited above - read in presented order. His blog's back up btw.
Mick N
Looks like this advice made it's way into the documentation recently too. http://msdn.microsoft.com/en-us/library/gg278407%28v=VS.92%29.aspx
Mick N
That is exactly the direction I've been looking for. Thanks a ton.
dkackman
Nice one.. yw :)
Mick N