C# Класс DotNetOpenAuth.OAuth2.AuthorizationServer

Authorization Server supporting the web server flow.
Показать файл Открыть проект Примеры использования класса

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

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

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

Метод Описание
GetCallback ( DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationRequest authorizationRequest ) : Uri

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

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

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

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

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

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.
Результат void

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

Initializes a new instance of the AuthorizationServer class.
public AuthorizationServer ( IAuthorizationServer authorizationServer ) : System
authorizationServer IAuthorizationServer The authorization server.
Результат System

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

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.
Результат System.Uri

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

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.
Результат DotNetOpenAuth.Messaging.OutgoingWebResponse

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

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.
Результат DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationSuccessResponseBase

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

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.
Результат DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationFailedResponse

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

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.
Результат void