C# Class DotNetOpenAuth.OAuth2.AuthorizationServer

Authorization Server supporting the web server flow.
Mostrar archivo Open project: OneCare/dotnetopenid Class Usage Examples

Public Methods

Method Description
ApproveAuthorizationRequest ( DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationRequest authorizationRequest, string userName, IEnumerable scopes = null, Uri callback = null ) : void

Approves an authorization request and sends an HTTP response to the user agent to redirect the user back to the Client.

AuthorizationServer ( IAuthorizationServer authorizationServer ) : System

Initializes a new instance of the AuthorizationServer class.

HandleTokenRequest ( System.Web.HttpRequestBase request = null ) : DotNetOpenAuth.Messaging.OutgoingWebResponse

Handles an incoming request to the authorization server's token endpoint.

PrepareApproveAuthorizationRequest ( DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationRequest authorizationRequest, string userName, IEnumerable scopes = null, Uri callback = null ) : DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationSuccessResponseBase

Approves an authorization request.

PrepareRejectAuthorizationRequest ( DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationRequest authorizationRequest, Uri callback = null ) : DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationFailedResponse

Prepares a response to inform the Client that the user has rejected the Client's authorization request.

RejectAuthorizationRequest ( EndUserAuthorizationRequest authorizationRequest, Uri callback = null ) : void

Rejects an authorization request and sends an HTTP response to the user agent to redirect the user back to the Client.

Protected Methods

Method Description
GetCallback ( DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationRequest authorizationRequest ) : Uri

Gets the redirect URL to use for a particular authorization request.

Private Methods

Method Description
PrepareAccessTokenResponse ( DotNetOpenAuth.OAuth2.Messages.AccessTokenRequestBase request, bool includeRefreshToken = true ) : DotNetOpenAuth.OAuth2.Messages.AccessTokenSuccessResponse

Prepares the response to an access token request.

ReadAuthorizationRequest ( System.Web.HttpRequestBase request = null ) : DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationRequest

Method Details

ApproveAuthorizationRequest() public method

Approves an authorization request and sends an HTTP response to the user agent to redirect the user back to the Client.
public ApproveAuthorizationRequest ( DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationRequest authorizationRequest, string userName, IEnumerable scopes = null, Uri callback = null ) : void
authorizationRequest DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationRequest The authorization request to approve.
userName string The username of the account that approved the request (or whose data will be accessed by the client).
scopes IEnumerable The scope of access the client should be granted. If null, all scopes in the original request will be granted.
callback System.Uri The Client callback URL to use when formulating the redirect to send the user agent back to the Client.
return void

AuthorizationServer() public method

Initializes a new instance of the AuthorizationServer class.
public AuthorizationServer ( IAuthorizationServer authorizationServer ) : System
authorizationServer IAuthorizationServer The authorization server.
return System

GetCallback() protected method

Gets the redirect URL to use for a particular authorization request.
Thrown if no callback URL could be determined.
protected GetCallback ( DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationRequest authorizationRequest ) : Uri
authorizationRequest DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationRequest The authorization request.
return System.Uri

HandleTokenRequest() public method

Handles an incoming request to the authorization server's token endpoint.
public HandleTokenRequest ( System.Web.HttpRequestBase request = null ) : DotNetOpenAuth.Messaging.OutgoingWebResponse
request System.Web.HttpRequestBase The HTTP request.
return DotNetOpenAuth.Messaging.OutgoingWebResponse

PrepareApproveAuthorizationRequest() public method

Approves an authorization request.
public PrepareApproveAuthorizationRequest ( DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationRequest authorizationRequest, string userName, IEnumerable scopes = null, Uri callback = null ) : DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationSuccessResponseBase
authorizationRequest DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationRequest The authorization request to approve.
userName string The username of the account that approved the request (or whose data will be accessed by the client).
scopes IEnumerable The scope of access the client should be granted. If null, all scopes in the original request will be granted.
callback System.Uri The Client callback URL to use when formulating the redirect to send the user agent back to the Client.
return DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationSuccessResponseBase

PrepareRejectAuthorizationRequest() public method

Prepares a response to inform the Client that the user has rejected the Client's authorization request.
public PrepareRejectAuthorizationRequest ( DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationRequest authorizationRequest, Uri callback = null ) : DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationFailedResponse
authorizationRequest DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationRequest The authorization request.
callback System.Uri The Client callback URL to use when formulating the redirect to send the user agent back to the Client.
return DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationFailedResponse

RejectAuthorizationRequest() public method

Rejects an authorization request and sends an HTTP response to the user agent to redirect the user back to the Client.
public RejectAuthorizationRequest ( EndUserAuthorizationRequest authorizationRequest, Uri callback = null ) : void
authorizationRequest EndUserAuthorizationRequest The authorization request to disapprove.
callback Uri The Client callback URL to use when formulating the redirect to send the user agent back to the Client.
return void