C# Класс 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
Наследование: Controller
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
GetSuccessResult System.Web.Mvc.ActionResult
OAuthGetErrorResult System.Web.Mvc.ActionResult
OAuthGetExtWindowSuccessResult System.Web.Mvc.ActionResult
OAuthGetFacebookLogOnUrl string
OAuthIsExtWindow bool
OAuthPrepareReturnUrl string
OAuthRegisterOrLoginExternalUser string

Открытые методы

Метод Описание
OAuth ( string serviceName ) : System.Web.Mvc.ActionResult
OAuthAccountController ( ) : System
OAuthLogOff ( ) : System.Web.Mvc.ActionResult
OpenId ( string ServiceUrl ) : System.Web.Mvc.ActionResult

Защищенные методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

GetErrorCodeFromString() защищенный Метод

protected GetErrorCodeFromString ( MembershipCreateStatus createStatus ) : string
createStatus MembershipCreateStatus
Результат string

OAuth() публичный Метод

public OAuth ( string serviceName ) : System.Web.Mvc.ActionResult
serviceName string
Результат System.Web.Mvc.ActionResult

OAuthAccountController() публичный Метод

public OAuthAccountController ( ) : System
Результат System

OAuthBeforeLogOn() защищенный Метод

Invoke this method in LogOn action before return LogOn View! There is initialized important data for _LogOnOAuth view.
protected OAuthBeforeLogOn ( ) : void
Результат void

OAuthGetErrorMessage() защищенный Метод

protected OAuthGetErrorMessage ( IAuthenticationResponse AuthenticationResponse ) : string
AuthenticationResponse IAuthenticationResponse
Результат string

OAuthLogOff() публичный Метод

public OAuthLogOff ( ) : System.Web.Mvc.ActionResult
Результат System.Web.Mvc.ActionResult

OpenId() публичный Метод

public OpenId ( string ServiceUrl ) : System.Web.Mvc.ActionResult
ServiceUrl string
Результат System.Web.Mvc.ActionResult