asp.net-mvcmodelopenidopenid-selector

Populate model parameter with the openid_identifier selected in the view?


I have been using openid selector to implement openid login on a web site following the tutorial here.

It all works ok but the openid_identifier is read in the controller from the request like so Request.Form["openid_identifier"] and I wanted to instead add the selected openid_identifier to the view model and have it set in there instead (so I can add other things to the view model or so I can test the controller more easily).

Can I do this? How?


Solution

  • Does changing

    public ActionResult Authenticate(string returnUrl)  
    

    to

    public ActionResult Authenticate(String returnUrl, String openid_identifier)
    

    do it for you?