C# Class Facebook.CanvasAuthContext

Exposes canvas based authentication model. Fits well for IFrame apps.
Inheritance: AuthContextBase, IAuthContext
Mostra file Open project: bbyk/graph.net Class Usage Examples

Public Properties

Property Type Description
EmptyParams string>.Dictionary

Private Properties

Property Type Description
GetSignedRequest JsonObject
ParseSignedRequest JsonObject
StripAwayProhibitedKeys string
ToFacebookSession Session
ValidateSession Session

Public Methods

Method Description
Authenticate ( [ context ) : bool

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

CanvasAuthContext ( [ bindings ) : System

Initializes a new CanvasAuthContext object with specified bindings.

GetLoginUrl ( Uri nextUrl ) : string

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

GetLoginUrl ( Uri nextUrl, string>.Dictionary @params ) : string

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

GetLoginUrl ( Uri nextUrl, LoginParams @params ) : string

See IAuthContext.GetLoginUrl(Uri, LoginParams).

GetLogoutUrl ( Uri nextUrl ) : string

See IAuthContext.GetLogoutUrl

GetLogoutUrl ( Uri nextUrl, string>.Dictionary @params ) : string

See IAuthContext.GetLogoutUrl

RedirectFromIFrame ( [ context, [ url ) : void

Generates and writes to response a javascript code to redirect to a url from iframe so that the url will be in browser's address bar. Calling the method completes current request.

ResolveCanvasPageUrl ( [ relativeUrl ) : string

Generates absolute url for a relative url on facebook application canvas (e.g. http://apps.facebook.com/graphdotnet/default.aspx).

ResolveSiteUrl ( [ relativeUrl ) : string

Generates absolute url for a relative url on the site (e.g. http://localhost/graph.net/default.aspx).

Private Methods

Method Description
GetSignedRequest ( NameValueCollection request ) : JsonObject
ParseSignedRequest ( string signedRequest ) : JsonObject
StripAwayProhibitedKeys ( Uri currentUrl ) : string
ToFacebookSession ( JsonObject data ) : Session
ValidateSession ( JsonObject data ) : Session

Method Details

Authenticate() public method

Authenticates current request. Returns true if the request is authenticated and an instance of Session is set; otherwise false.
is null.
public Authenticate ( [ context ) : bool
context [ the current request context information.
return bool

CanvasAuthContext() public method

Initializes a new CanvasAuthContext object with specified bindings.
is null.
public CanvasAuthContext ( [ bindings ) : System
bindings [ Application facebook bindings: appid, secret, site url, canvas page.
return System

GetLoginUrl() public method

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

GetLoginUrl() public method

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

GetLoginUrl() public method

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

GetLogoutUrl() public method

See IAuthContext.GetLogoutUrl
is null.
public GetLogoutUrl ( Uri nextUrl ) : string
nextUrl System.Uri
return string

GetLogoutUrl() public method

See IAuthContext.GetLogoutUrl
is null.
public GetLogoutUrl ( Uri nextUrl, string>.Dictionary @params ) : string
nextUrl System.Uri
@params string>.Dictionary
return string

RedirectFromIFrame() public static method

Generates and writes to response a javascript code to redirect to a url from iframe so that the url will be in browser's address bar. Calling the method completes current request.
either or is null.
public static RedirectFromIFrame ( [ context, [ url ) : void
context [ Http context the of which is used to issue the js.
url [ an url to redirect to.
return void

ResolveCanvasPageUrl() public method

Generates absolute url for a relative url on facebook application canvas (e.g. http://apps.facebook.com/graphdotnet/default.aspx).
is null.
public ResolveCanvasPageUrl ( [ relativeUrl ) : string
relativeUrl [ a relative url to convert to absolute (e.g. ~/default.aspx).
return string

ResolveSiteUrl() public method

Generates absolute url for a relative url on the site (e.g. http://localhost/graph.net/default.aspx).
is null.
public ResolveSiteUrl ( [ relativeUrl ) : string
relativeUrl [ a relative url to convert to absolute (e.g. ~/default.aspx).
return string

Property Details

EmptyParams public_oe static_oe property

public static Dictionary EmptyParams
return string>.Dictionary