コード例 #1
0
        public async Task <TokenResponse> GetAccessTokenAsync(TokenRequest request)
        {
            IntPtr requestHandle = GetRequestHandle(request as ClientCredentialsTokenRequest);

            return(await Task.Run(() => GetAccessToken(requestHandle)));
        }
コード例 #2
0
 /// <summary>
 /// Access token can be retreived implicitly using <see cref="ClientCredentialsAuthorizer.AuthorizeAsync"/> in this flow.
 /// </summary>
 /// <since_tizen> 3 </since_tizen>
 /// <exception cref="InvalidOperationException">Thrown when the operation is not supported</exception>
 public Task <TokenResponse> GetAccessTokenAsync(TokenRequest request)
 {
     Log.Error(ErrorFactory.LogTag, "Obtain token directly from authorization grant ");
     throw new InvalidOperationException();
 }
コード例 #3
0
        /// <summary>
        /// Retrieves access token by exchanging authorization code received using <see cref="AuthorizeAsync(AuthorizationRequest)"/>.
        /// The authroization request parameters should be as defined in https://tools.ietf.org/html/rfc6749#section-4.1.3
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        /// <param name="request">The token request <see cref="CodeGrantTokenRequest"/></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 override async Task <TokenResponse> GetAccessTokenAsync(TokenRequest request)
        {
            IntPtr requestHandle = GetRequestHandle(request as CodeGrantTokenRequest);

            return(await Task.Run(() => GetAccessTokenByCode(requestHandle)));
        }
コード例 #4
0
ファイル: Authorizer.cs プロジェクト: yourina/TizenFX
 /// <summary>
 /// Gets the access token in OAuth2 supported grant flows except Implicit Grant flow.
 /// </summary>
 /// <since_tizen> 3 </since_tizen>
 /// <see cref="CodeGrantAuthorizer.AuthorizeAsync(AuthorizationRequest)"/>
 /// <see cref="ImplicitGrantAuthorizer.AuthorizeAsync(AuthorizationRequest)"/>
 /// <param name="request">A token request</param>
 /// <returns>The response from server</returns>
 public virtual Task <TokenResponse> GetAccessTokenAsync(TokenRequest request)
 {
     throw new NotImplementedException();
 }
コード例 #5
0
        /// <summary>
        /// Retrieves access token by sending resource owner's password credentials.
        /// The authroization request parameters should be as defined in https://tools.ietf.org/html/rfc6749#section-4.3.2
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        /// <param name="request">The token request <see cref="ResourceOwnerPwdCredentialsTokenRequest"/></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 override async Task <TokenResponse> GetAccessTokenAsync(TokenRequest request)
        {
            IntPtr requestHandle = GetRequestHandle(request as ResourceOwnerPwdCredentialsTokenRequest);

            return(await Task.Run(() => GetAccessToken(requestHandle)));
        }