I am trying to find a good way to handle the following scenario (I am still new to this):
A user can register through my site using the RPX / OpenId provider.
Step 1: The user authenticates through the provider. The provider returns a temporary token to one of my action methods.
Step 2: I use a token to capture user profile information and load a view that allows them to enter any missing required fields and optional fields.
In step 2, I use 2 methods of action: one for processing information capture using a token. The second action, which accepts authorization information and loads a representation of the missing / additional fields.
I pass the authorization information through TempData to the second step. The second action can handle validation, so there is a chance that I will need to hold the authorization object for more than one request. I canβt use the token to regenerate the authorization information, because it is technically a one-time token, and it would be foolish to regenerate the request because it uses network resources.
How can I save objects in my TempData for any subsequent requests to the same action, but delete objects for any redirects? And since this may be a repeatable pattern in my application, should I create a filter to automatically handle this situation?
For example, I present a filter attribute that combines TempData (if any) in ViewData. But how will I save my data in future calls of the same action? Throw it in TempData again? And if I detect redirection with empty TempData?
thanks
source share