C# Класс Facebook.OAuthContext

Exposes site based authentication model. Fits well for a connected site.
Наследование: AuthContextBase, IAuthContext
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
EmptyParams string>.Dictionary

Private Properties

Свойство Тип Описание
ParseAuthResult void
SaveSession void

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

Метод Описание
Authenticate ( [ code, [ redirectUri ) : void

Authenticates with a code given synchronously. See for more information.

AuthenticateRequest ( [ context ) : bool

Authenticates current request synchronously. Returns true if the request is authenticated and Session is set; otherwise false.

BeginAuthenticate ( [ code, [ redirectUri, AsyncCallback cb, object state ) : IAsyncResult

Begins to authenticates with a code given synchronously. See for more information.

BeginAuthenticateRequest ( [ context, [ cb, [ state ) : IAsyncResult

Begin to authenticate current request synchronously. Returns true if the request is authenticated and Session is set; otherwise false.

EndAuthenticate ( IAsyncResult ar ) : void

Completes async authentication operation started by the BeginAuthenticate method.

EndAuthenticateRequest ( [ ar ) : bool

Fetches state of async operation. Corresponds to BeginAuthenticate method. Returns true if the request is authenticated and Session is set; otherwise false.

GetLoginUrl ( [ nextUrl ) : string

See IAuthContext.GetLoginUrl(Uri, Dictionary{String, String}).

GetLoginUrl ( [ nextUrl, [ @params ) : string

See IAuthContext.GetLoginUrl(Uri, LoginParams).

GetLoginUrl ( [ nextUrl, string>.[ @params ) : string

See IAuthContext.GetLoginUrl(Uri, Dictionary{String, String}).

GetLogoutUrl ( [ nextUrl ) : string

See IAuthContext.GetLogoutUrl(Uri, Dictionary{String, String}).

GetLogoutUrl ( [ nextUrl, string>.[ @params ) : string

See IAuthContext.GetLogoutUrl(Uri, Dictionary{String, String}).

OAuthContext ( [ appId, [ appSecret ) : System

Initializes a new OAuthContext object with specified appId and appSecret.

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

Метод Описание
GetCurrentUrl ( HttpContext context ) : string

Generates url from the current HttpRequest.Url which is useful to pass into Authenticate or BeginAuthenticate methods as the redirectUri argument.

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

Метод Описание
ParseAuthResult ( string contentType, string json ) : void
SaveSession ( HttpContext context ) : void

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

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

Authenticates with a code given synchronously. See for more information.
The operation took longer then . either or is null.
public Authenticate ( [ code, [ redirectUri ) : void
code [ a verification string passed in the query string argument code when redirecting to
redirectUri [ a url which was passed to as next url argument. It should not contain query part.
Результат void

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

Authenticates current request synchronously. Returns true if the request is authenticated and Session is set; otherwise false.
is null. The operation took longer then .
public AuthenticateRequest ( [ context ) : bool
context [ http context to authenticate.
Результат bool

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

Begins to authenticates with a code given synchronously. See for more information.
either or is null.
public BeginAuthenticate ( [ code, [ redirectUri, AsyncCallback cb, object state ) : IAsyncResult
code [ a verification string passed in the query string argument code when redirecting to
redirectUri [ a url which was passed to as next url argument. It should not contain query part.
cb AsyncCallback a callback to call upon operation is completed.
state object the user state to pass to the callback.
Результат IAsyncResult

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

Begin to authenticate current request synchronously. Returns true if the request is authenticated and Session is set; otherwise false.
is null.
public BeginAuthenticateRequest ( [ context, [ cb, [ state ) : IAsyncResult
context [ http context to authenticate.
cb [ a callback to call upon operation is completed.
state [ the user state to pass to the callback.
Результат IAsyncResult

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

Completes async authentication operation started by the BeginAuthenticate method.
is null.
public EndAuthenticate ( IAsyncResult ar ) : void
ar IAsyncResult async state of the operation.
Результат void

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

Fetches state of async operation. Corresponds to BeginAuthenticate method. Returns true if the request is authenticated and Session is set; otherwise false.
is null.
public EndAuthenticateRequest ( [ ar ) : bool
ar [ async state of the operation.
Результат bool

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

Generates url from the current HttpRequest.Url which is useful to pass into Authenticate or BeginAuthenticate methods as the redirectUri argument.
protected GetCurrentUrl ( HttpContext context ) : string
context System.Web.HttpContext
Результат string

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

See IAuthContext.GetLoginUrl(Uri, Dictionary{String, String}).
is null.
public GetLoginUrl ( [ nextUrl ) : string
nextUrl [
Результат string

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

See IAuthContext.GetLoginUrl(Uri, LoginParams).
is null.
public GetLoginUrl ( [ nextUrl, [ @params ) : string
nextUrl [
@params [
Результат string

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

See IAuthContext.GetLoginUrl(Uri, Dictionary{String, String}).
is null.
public GetLoginUrl ( [ nextUrl, string>.[ @params ) : string
nextUrl [
@params string>.[
Результат string

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

See IAuthContext.GetLogoutUrl(Uri, Dictionary{String, String}).
is null.
public GetLogoutUrl ( [ nextUrl ) : string
nextUrl [
Результат string

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

See IAuthContext.GetLogoutUrl(Uri, Dictionary{String, String}).
is null.
public GetLogoutUrl ( [ nextUrl, string>.[ @params ) : string
nextUrl [
@params string>.[
Результат string

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

Initializes a new OAuthContext object with specified appId and appSecret.
either or is null.
public OAuthContext ( [ appId, [ appSecret ) : System
appId [ Facebook application id.
appSecret [ Application secret.
Результат System

Описание свойств

EmptyParams публичное статическое свойство

public static Dictionary EmptyParams
Результат string>.Dictionary