/// <summary> /// Authorization not supported through this API for this flow. /// </summary> /// <since_tizen> 3 </since_tizen> /// <exception cref="InvalidOperationException">Thrown when the operation is not supported</exception> public Task <AuthorizationResponse> AuthorizeAsync(AuthorizationRequest request) { Log.Error(ErrorFactory.LogTag, "Authorization is not supported in this flow"); throw new InvalidOperationException(); }
/// <summary> /// Authorizes the client with access toekn / authorizaion code in Implicit and Authorization Code grant flows respectively. /// </summary> /// <since_tizen> 3 </since_tizen> /// <see cref="CodeGrantAuthorizer.AuthorizeAsync(AuthorizationRequest)"/> /// <see cref="ImplicitGrantAuthorizer.AuthorizeAsync(AuthorizationRequest)"/> /// <param name="request">An authorization request</param> /// <returns> The authorization response from server</returns> public virtual Task <AuthorizationResponse> AuthorizeAsync(AuthorizationRequest request) { throw new NotImplementedException(); }
/// <summary> /// Retrieves access token asynchronously. The authroization request parameters should be as defined in https://tools.ietf.org/html/rfc6749#section-4.2.1 /// </summary> /// <since_tizen> 3 </since_tizen> /// <param name="request">The authorization request <see cref="ImplicitGrantAuthorizationRequest"/></param> /// <returns>The response containing access token.</returns> /// <privilege>http://tizen.org/privilege/internet</privilege> /// <exception cref="ArgumentException">Thrown when method failed due to invalid argumets</exception> /// <exception cref="OAuth2Exception">Thrown when method fails due to server error</exception> public new virtual async Task <TokenResponse> AuthorizeAsync(AuthorizationRequest request) { IntPtr requestHandle = GetRequestHandle(request as ImplicitGrantAuthorizationRequest); return(await Task.Run(() => GetAuthorizationResponse(requestHandle))); }
/// <summary> /// Retrieves authorization code asynchronously. The authroization request parameters should be as defined in https://tools.ietf.org/html/rfc6749#section-4.1.1 /// </summary> /// <since_tizen> 3 </since_tizen> /// <param name="request">The authorization request <see cref="CodeGrantAuthorizationRequest"/></param> /// <returns>The response containing authorization code.</returns> /// <privilege>http://tizen.org/privilege/internet</privilege> /// <exception cref="ArgumentException">Thrown when method failed due to invalid argumets</exception> /// <exception cref="OAuth2Exception">Thrown when method fails due to server error</exception> public override async Task <AuthorizationResponse> AuthorizeAsync(AuthorizationRequest request) { IntPtr requestHandle = GetRequestHandle(request as CodeGrantAuthorizationRequest); return(await Task.Run(() => GetAuthorizationResponse(requestHandle))); }