C# 클래스 pokitdokcsharp.OauthApplicationClient

Oauth 2.0 Client implementing Client Credentials Grant Authorization http://tools.ietf.org/html/rfc6749#section-4.4
파일 보기 프로젝트 열기: pokitdok/pokitdok-csharp

공개 프로퍼티들

프로퍼티 타입 설명
_accessTokenRenewer System.Threading.Timer

공개 메소드들

메소드 설명
Authenticate ( ) : OauthAccessToken

Get an access token and setup a timer to refresh the token

CreateRequest ( object>.Dictionary data, string url, string method, string content_type = "application/json" ) : HttpWebRequest

Forms the HttpWebRequest

DeAuthenticate ( ) : OauthAccessToken

Calls an endpoint on the PokitDok server to remove client access tokens.

DeleteRequest ( string requestPath ) : ResponseData

Perform a DELETE request for the given resource

GetRequest ( string requestPath, string>.Dictionary parameters = null ) : ResponseData

Perform a GET request given the http request path and a dictionary of query parameters.

OauthApplicationClient ( string clientId, string clientSecret, int requestTimeout = DEFAULT_TIMEOUT, OauthAccessToken accessToken = null, Uri redirectUrl = null, TokenRefreshDelegate tokenRefresh = null, string scope = null, string authCode = null ) : System

Initializes a new instance of the pokitdokcsharp.OauthApplicationClient class.

PostRequest ( string requestPath, object>.Dictionary postData ) : ResponseData

Perform a POST request given the http request path and a dictionary representing the JSON post body.

PostRequest ( string requestPath, string postFilePath, string postFileContentDispositionName, string postFileContentType, string>.Dictionary parameters = null ) : ResponseData

Perform a POST request given the http request path and a file to post with optional form field parameters.

PutRequest ( string requestPath, object>.Dictionary putData ) : ResponseData

Perform a PUT request given the uri and put data form fields

비공개 메소드들

메소드 설명
AuthenticateAuthorizationCode ( ) : OauthAccessToken
AuthenticateClientCredentials ( ) : OauthAccessToken
AuthenticateRefreshToken ( ) : OauthAccessToken
AuthenticateRequest ( WebRequest webRequest, byte request_bytes ) : OauthAccessToken
GetPostStream ( string filePath, string fileContentType, string fileContentDispositionName, NameValueCollection formData, string boundary ) : Stream

Builds a Stream of multipart form data from file and form fields.

OnTokenExpiredCallback ( object stateInfo ) : void

Raises the token expired callback event.

ProcessResponse ( HttpWebResponse response ) : ResponseData

Processes the http response into a pokitdokcsharp.ResponseData object.

isAccessTokenExpired ( ) : bool

Check if the access token is expired

메소드 상세

Authenticate() 공개 메소드

Get an access token and setup a timer to refresh the token
Thrown when authentication fails or /// when some unknown system error occurs.
public Authenticate ( ) : OauthAccessToken
리턴 OauthAccessToken

CreateRequest() 공개 메소드

Forms the HttpWebRequest
public CreateRequest ( object>.Dictionary data, string url, string method, string content_type = "application/json" ) : HttpWebRequest
data object>.Dictionary data to be converted to JSON. Need to know the length
url string URL
method string post, put, delete, get
content_type string should always be application/json (default)
리턴 System.Net.HttpWebRequest

DeAuthenticate() 공개 메소드

Calls an endpoint on the PokitDok server to remove client access tokens.
public DeAuthenticate ( ) : OauthAccessToken
리턴 OauthAccessToken

DeleteRequest() 공개 메소드

Perform a DELETE request for the given resource
public DeleteRequest ( string requestPath ) : ResponseData
requestPath string Request path/resource
리턴 ResponseData

GetRequest() 공개 메소드

Perform a GET request given the http request path and a dictionary of query parameters.
Thrown when unknown system error occurs.
public GetRequest ( string requestPath, string>.Dictionary parameters = null ) : ResponseData
requestPath string Request path.
parameters string>.Dictionary Dictionary of query parameters.
리턴 ResponseData

OauthApplicationClient() 공개 메소드

Initializes a new instance of the pokitdokcsharp.OauthApplicationClient class.
public OauthApplicationClient ( string clientId, string clientSecret, int requestTimeout = DEFAULT_TIMEOUT, OauthAccessToken accessToken = null, Uri redirectUrl = null, TokenRefreshDelegate tokenRefresh = null, string scope = null, string authCode = null ) : System
clientId string Client identifier.
clientSecret string Client secret.
requestTimeout int Request timeout.
accessToken OauthAccessToken Access token.
redirectUrl System.Uri The Platform App redirect url.
tokenRefresh TokenRefreshDelegate Invoked when access token is refreshed.
scope string The requested scopes
authCode string The authorization code recieved by the scope grant of the Platform App
리턴 System

PostRequest() 공개 메소드

Perform a POST request given the http request path and a dictionary representing the JSON post body.
Thrown when unknown system error occurs.
public PostRequest ( string requestPath, object>.Dictionary postData ) : ResponseData
requestPath string Request path.
postData object>.Dictionary Post data: dictionary representing JSON data
리턴 ResponseData

PostRequest() 공개 메소드

Perform a POST request given the http request path and a file to post with optional form field parameters.
Thrown when unknown system error occurs.
public PostRequest ( string requestPath, string postFilePath, string postFileContentDispositionName, string postFileContentType, string>.Dictionary parameters = null ) : ResponseData
requestPath string Request path.
postFilePath string File system path of file data to be posted.
postFileContentDispositionName string Post file content disposition name.
postFileContentType string Post file content type.
parameters string>.Dictionary Dictionary of form data parameters.
리턴 ResponseData

PutRequest() 공개 메소드

Perform a PUT request given the uri and put data form fields
public PutRequest ( string requestPath, object>.Dictionary putData ) : ResponseData
requestPath string Request path.
putData object>.Dictionary Put data: dictionary representing JSON data.
리턴 ResponseData

프로퍼티 상세

_accessTokenRenewer 공개적으로 프로퍼티

public Timer,System.Threading _accessTokenRenewer
리턴 System.Threading.Timer