C# Class DataAvail.Mvc.Account.OAuthAccountController

1. Derive your current account controller with this one. /// a. Override GetErrorCodeFromString() method. /// b. In LogOn Action add base.BeforeLogOn() before return View. 2. Add da.openid.css to _Layout page 2. Add @Html.Partial("_LogOnOAuth") to the LogOn view. 3. Add @Html.Partial("_LogInOAuth") to the LogIn view. 4. Define Twitter and Facebook keys in the config file. 5. In the web.conig file add to the membership profile tag - inherits="YOUR_NAMESPACE.AccountProfile" After this the tag should look like this 6. Add to _Layout.html
Inheritance: Controller
ファイルを表示 Open project: data-avail/open-mvc

Private Properties

Property Type Description
GetSuccessResult System.Web.Mvc.ActionResult
OAuthGetErrorResult System.Web.Mvc.ActionResult
OAuthGetExtWindowSuccessResult System.Web.Mvc.ActionResult
OAuthGetFacebookLogOnUrl string
OAuthIsExtWindow bool
OAuthPrepareReturnUrl string
OAuthRegisterOrLoginExternalUser string

Public Methods

Method Description
OAuth ( string serviceName ) : System.Web.Mvc.ActionResult
OAuthAccountController ( ) : System
OAuthLogOff ( ) : System.Web.Mvc.ActionResult
OpenId ( string ServiceUrl ) : System.Web.Mvc.ActionResult

Protected Methods

Method Description
GetErrorCodeFromString ( MembershipCreateStatus createStatus ) : string
OAuthBeforeLogOn ( ) : void

Invoke this method in LogOn action before return LogOn View! There is initialized important data for _LogOnOAuth view.

OAuthGetErrorMessage ( IAuthenticationResponse AuthenticationResponse ) : string

Private Methods

Method Description
GetSuccessResult ( OAuthServiceType ServiceType, string UserName, string ReturnUrl ) : System.Web.Mvc.ActionResult
OAuthGetErrorResult ( string ErrorMessage = null ) : System.Web.Mvc.ActionResult
OAuthGetExtWindowSuccessResult ( string UserName, string ReturnUrl ) : System.Web.Mvc.ActionResult
OAuthGetFacebookLogOnUrl ( string UrlAuthority, string ReturnUrl ) : string
OAuthIsExtWindow ( OAuthServiceType ServiceType ) : bool
OAuthPrepareReturnUrl ( ) : string
OAuthRegisterOrLoginExternalUser ( string UserName, OAuthServiceLogOnIdentifyer ServiceIdentifyer ) : string

Method Details

GetErrorCodeFromString() protected method

protected GetErrorCodeFromString ( MembershipCreateStatus createStatus ) : string
createStatus MembershipCreateStatus
return string

OAuth() public method

public OAuth ( string serviceName ) : System.Web.Mvc.ActionResult
serviceName string
return System.Web.Mvc.ActionResult

OAuthAccountController() public method

public OAuthAccountController ( ) : System
return System

OAuthBeforeLogOn() protected method

Invoke this method in LogOn action before return LogOn View! There is initialized important data for _LogOnOAuth view.
protected OAuthBeforeLogOn ( ) : void
return void

OAuthGetErrorMessage() protected method

protected OAuthGetErrorMessage ( IAuthenticationResponse AuthenticationResponse ) : string
AuthenticationResponse IAuthenticationResponse
return string

OAuthLogOff() public method

public OAuthLogOff ( ) : System.Web.Mvc.ActionResult
return System.Web.Mvc.ActionResult

OpenId() public method

public OpenId ( string ServiceUrl ) : System.Web.Mvc.ActionResult
ServiceUrl string
return System.Web.Mvc.ActionResult