Click here to Skip to main content
   

ASP.NET

 
AnswerRe: Sign in with ASP.NET Pinmemberjain jinesh26-Feb-13 20:12 
GeneralRe: Sign in with ASP.NET Pinmemberomarbench26-Feb-13 21:47 
Questionunable to change Web.SiteMap Pinmemberjojoba201126-Feb-13 0:58 
AnswerRe: unable to change Web.SiteMap PinmvpSandeep Mewara26-Feb-13 3:24 
GeneralRe: unable to change Web.SiteMap Pinmemberjojoba201126-Feb-13 5:12 
QuestionBinding gridview from two tables Pinmemberdemoninside925-Feb-13 23:45 
AnswerRe: Binding gridview from two tables PinmemberDavid Mujica26-Feb-13 6:09 
Questioncustom MVC authorization and Authorize PinmemberSuper Lloyd25-Feb-13 21:07 
1st I'm a beginner MVC developer!
 
At any rate I wanted to add Facebook login to my (personal) website and didn't want to use the build in authentication (why bother the user with one more very forgettable useless password?)
 
So I deleted all authorization code and I have an account controller which take the facebook id and check it against Facebook server and set up a Session property with relevant Facebook data
 
now when I add an [Auhorize] attribute on my method it doesn't work (normal)
I wonder how I could setup the user!
I have code which create an IPrincipal (from facebook info) and set it to the HttpContext.User but it's lost on next query.
 
I tried override myControl.Initialize(RequestConterxt) and setup the current user (as in request.HttpContext.User = ...)
 
But I got a stranger error when I do that (which involve none of my code!!!!!):
[NullReferenceException: Object reference not set to an instance of an object.]
   System.Web.Mvc.Controller.PossiblyLoadTempData() +52
   System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state) +92
   System.Web.Mvc.Async.WrappedAsyncResult`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +161
   System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate`1 endDelegate, Object tag, Int32 timeout) +92
   System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate endDelegate, Object tag, Int32 timeout) +97
   System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate endDelegate, Object tag) +53
   System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +417
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +49
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__2(AsyncCallback asyncCallback, Object asyncState) +127
   System.Web.Mvc.Async.WrappedAsyncResult`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +161
   System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate`1 endDelegate, Object tag, Int32 timeout) +92
   System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate endDelegate, Object tag, Int32 timeout) +97
   System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate endDelegate, Object tag) +53
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +373
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +88
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +50
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +301
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
 
To summarize how could I use the [Authorize] attribute with my facebook user info?
My programming get away... The Blog...
DirectX for WinRT/C# since 2013!
Taking over the world since 1371!

QuestionMVC Model + Entity Design Guidance Needed. Pinmembernlarson1125-Feb-13 12:51 
QuestionDevelop a Custom Login page PinmemberMeherab Bhamgara25-Feb-13 4:24 
AnswerRe: Develop a Custom Login page PinmvpSandeep Mewara25-Feb-13 19:13 
AnswerRe: Develop a Custom Login page PinmvpRahul Rajat Singh25-Feb-13 21:04 
Questionproblem with intelligencia.urlrewriter PinmemberC#Programmer201224-Feb-13 23:32 
AnswerRe: problem with intelligencia.urlrewriter PinmemberC#Programmer201225-Feb-13 18:57 
QuestionRe: problem with intelligencia.urlrewriter Pinmemberryanb3126-Feb-13 11:35 
AnswerRe: problem with intelligencia.urlrewriter PinmemberC#Programmer201226-Feb-13 18:48 
QuestionMaintaining Array Data in an SQL Database. PinmemberBram van Kampen24-Feb-13 16:23 
AnswerRe: Maintaining Array Data in an SQL Database. PinmemberDavid Mujica25-Feb-13 4:02 
Questionsaving and retrieving recent activities PinmemberJassim Rahma24-Feb-13 5:40 
AnswerRe: saving and retrieving recent activities Pinmemberjkirkerx26-Feb-13 12:04 
Generalasp.net export to excel Pinmemberpppppsssss24-Feb-13 1:50 
GeneralRe: asp.net export to excel PinmvpSandeep Mewara24-Feb-13 2:18 
AnswerRe: asp.net export to excel Pinmemberryanb3126-Feb-13 11:37 
Questionhow to linbutton's text on another page button click event PinmemberMember 870181323-Feb-13 3:56 
AnswerRe: how to linbutton's text on another page button click event PinmvpSandeep Mewara23-Feb-13 4:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.150327.1 | Last Updated 30 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid