C# Class Facebook.OAuthContext

Exposes site based authentication model. Fits well for a connected site.
Inheritance: AuthContextBase, IAuthContext
Show file Open project: bbyk/graph.net Class Usage Examples

Public Properties

Property Type Description
EmptyParams string>.Dictionary

Private Properties

Property Type Description
ParseAuthResult void
SaveSession void

Public Methods

Method Description
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.

Protected Methods

Method Description
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.

Private Methods

Method Description
ParseAuthResult ( string contentType, string json ) : void
SaveSession ( HttpContext context ) : void

Method Details

Authenticate() public method

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.
return void

AuthenticateRequest() public method

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.
return bool

BeginAuthenticate() public method

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.
return IAsyncResult

BeginAuthenticateRequest() public method

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.
return IAsyncResult

EndAuthenticate() public method

Completes async authentication operation started by the BeginAuthenticate method.
is null.
public EndAuthenticate ( IAsyncResult ar ) : void
ar IAsyncResult async state of the operation.
return void

EndAuthenticateRequest() public method

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.
return bool

GetCurrentUrl() protected method

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
return string

GetLoginUrl() public method

See IAuthContext.GetLoginUrl(Uri, Dictionary{String, String}).
is null.
public GetLoginUrl ( [ nextUrl ) : string
nextUrl [
return string

GetLoginUrl() public method

See IAuthContext.GetLoginUrl(Uri, LoginParams).
is null.
public GetLoginUrl ( [ nextUrl, [ @params ) : string
nextUrl [
@params [
return string

GetLoginUrl() public method

See IAuthContext.GetLoginUrl(Uri, Dictionary{String, String}).
is null.
public GetLoginUrl ( [ nextUrl, string>.[ @params ) : string
nextUrl [
@params string>.[
return string

GetLogoutUrl() public method

See IAuthContext.GetLogoutUrl(Uri, Dictionary{String, String}).
is null.
public GetLogoutUrl ( [ nextUrl ) : string
nextUrl [
return string

GetLogoutUrl() public method

See IAuthContext.GetLogoutUrl(Uri, Dictionary{String, String}).
is null.
public GetLogoutUrl ( [ nextUrl, string>.[ @params ) : string
nextUrl [
@params string>.[
return string

OAuthContext() public method

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.
return System

Property Details

EmptyParams public static property

public static Dictionary EmptyParams
return string>.Dictionary