Click here to Skip to main content
15,886,806 members
Articles / Desktop Programming / WPF

Working with Google Drive in WPF

Rate me:
Please Sign up or sign in to vote.
4.96/5 (20 votes)
6 Mar 2013CPOL19 min read 84.8K   4.9K   74  
Authenticating and uploading files to Google Drive.
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>Google.Apis.Authentication.OAuth2</name>
    </assembly>
    <members>
        <member name="T:Google.Apis.Authentication.OAuth2.GoogleAuthenticationServer">
            <summary>
            Class containing information about the Google OAuth2 authentication server.
            </summary>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.GoogleAuthenticationServer.Description">
            <summary>
            Returns the description for the Google Authorization Server.
            </summary>
            <returns></returns>
        </member>
        <member name="T:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.NativeApplicationClient">
            <summary>
            The OAuth2 client for use by native applications. This is a partial implementation which 
            should be used until the feature has been fully implemented in DotNetOpenAuth.
            </summary>
        </member>
        <member name="F:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.NativeApplicationClient.OutOfBandCallbackUrl">
            <summary>
            Represents a callback URL which points to a special out of band page used for native OAuth2 authorization.
            This URL will cause the authorization code to appear in the title of the window.
            </summary>
            <remarks>See http://code.google.com/apis/accounts/docs/OAuth2.html for more information.</remarks>
        </member>
        <member name="M:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.NativeApplicationClient.#ctor(DotNetOpenAuth.OAuth2.AuthorizationServerDescription,System.String,System.String)">
            <summary>
            Initializes a new instance of the <see cref="T:DotNetOpenAuth.OAuth2.UserAgentClient"/> class.
            </summary>
            <param name="authorizationServer">The token issuer.</param>
            <param name="clientIdentifier">The client identifier.</param>
            <param name="clientSecret">The client secret.</param>
        </member>
        <!-- Badly formed XML comment ignored for member "M:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.NativeApplicationClient.#ctor(DotNetOpenAuth.OAuth2.AuthorizationServerDescription)" -->
        <member name="M:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.NativeApplicationClient.#ctor(System.Uri)">
            <summary>
            Initializes a new instance of the <see cref="T:DotNetOpenAuth.OAuth2.UserAgentClient"/> class.
            </summary>
            <param name="authorizationEndpoint">The authorization endpoint.</param>
        </member>
        <member name="M:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.NativeApplicationClient.RequestUserAuthorization(System.Collections.Generic.IEnumerable{System.String})">
            <summary>
            Creates the URL which should be used by the user to request the initial authorization.
            Uses the default Out-of-band-URI as a callback.
            </summary>
            <param name="scope">Set of requested scopes</param>
            <returns>URI pointing to the authorization server</returns>
        </member>
        <member name="M:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.NativeApplicationClient.RequestUserAuthorization">
            <summary>
            Creates the URL which should be used by the user to request the initial authorization.
            Uses the default Out-of-band-URI as a callback.
            </summary>
            <returns>URI pointing to the authorization server</returns>
        </member>
        <member name="M:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.NativeApplicationClient.ProcessUserAuthorization(System.String,DotNetOpenAuth.OAuth2.IAuthorizationState)">
            <summary>
            Uses the provided authorization code to create an authorization state.
            </summary>
            <param name="authCode">The authorization code for getting an access token.</param>
            <param name="authorizationState">The authorization.  Optional.</param>
            <returns>The granted authorization, or <c>null</c> if the authorization was null or rejected.</returns>
        </member>
        <member name="M:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.NativeApplicationClient.ProcessUserAuthorization(System.String)">
            <summary>
            Uses the provided authorization code to create an authorization state.
            </summary>
            <param name="authCode">The authorization code for getting an access token.</param>
            <returns>The granted authorization, or <c>null</c> if the authorization was null or rejected.</returns>
        </member>
        <member name="T:Google.Apis.Authentication.OAuth2.OAuth2Authenticator`1">
            <summary>
            Implements an OAuth2 authenticator using the DotNetOpenAuth library.
            </summary>
        </member>
        <member name="M:Google.Apis.Authentication.OAuth2.OAuth2Authenticator`1.#ctor(`0,System.Func{`0,DotNetOpenAuth.OAuth2.IAuthorizationState})">
            <summary>
            Creates a new OAuth2 authenticator.
            </summary>
            <param name="tokenProvider">The client which is used for requesting access and refresh tokens.</param>
            <param name="authProvider">The method which provides the initial authorization for the provider.</param>
        </member>
        <member name="M:Google.Apis.Authentication.OAuth2.OAuth2Authenticator`1.LoadAccessToken">
            <summary>
            Checks if an access token has been set. If this is not the case, this method will use the specified
            State provider to generate a new AuthorizationState.
            </summary>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.OAuth2Authenticator`1.State">
            <summary>
            The current state of this authenticator
            </summary>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.OAuth2Authenticator`1.NoCaching">
            <summary>
            If this option is set to true, the authorization state will only last for a single request, and
            authorization will be re-requested for every additional request.
            </summary>
            <remarks>
            Will clear the current state if set to true. Can be used by Webserver-Applications
            to allow multiple AuthorizationStates/users.
            </remarks>
        </member>
        <member name="T:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowHeader">
            <summary>
            Assertion flow header used to generate the assertion flow message header.
            </summary>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowHeader.Algorithm">
            <summary>
            Gets or sets the encryption algorithm used by the assertion flow message.
            </summary>
            <value>
            The alg.
            </value>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowHeader.Type">
            <summary>
            Gets or sets the type of the claim.
            </summary>
            <value>
            The typ.
            </value>
        </member>
        <member name="T:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.GoogleAssertionFlowHeader">
            <summary>
            Google assertion flow header holding Google supported values.
            </summary>
        </member>
        <member name="F:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.GoogleAssertionFlowHeader.GoogleSigningAlgorithm">
            <summary>
            The google signing algorithm, currently RSA-SHA256
            <see cref="!:https://developers.google.com/accounts/docs/OAuth2ServiceAccount#formingheader"/>.
            </summary>
        </member>
        <member name="F:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.GoogleAssertionFlowHeader.GoogleAssertionType">
            <summary>
            The type of the google assertion, currently JSON Web Token
            <see cref="!:https://developers.google.com/accounts/docs/OAuth2ServiceAccount#formingheader"/>
            </summary>
        </member>
        <member name="T:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClaim">
            <summary>
            Assertion flow claim used to generate the assertion flow message claim.
            </summary>
        </member>
        <member name="M:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClaim.#ctor">
            <summary>
            Initializes a new instance of the
            <see cref="T:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClaim"/> class.
            </summary>
        </member>
        <member name="M:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClaim.#ctor(DotNetOpenAuth.OAuth2.AuthorizationServerDescription)">
            <summary>
            Initializes a new instance of the
            <see cref="T:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClaim"/> class.
            </summary>
            <param name="authorizationServer">
            Authorization server description.
            </param>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClaim.Issuer">
            <summary>
            Gets or sets the assertion flow issuer (e.g client ID).
            </summary>
            <value>
            The issuer.
            </value>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClaim.Principal">
            <summary>
            Gets or sets the service account user (for domain-wide delegation).
            </summary>
            <value>
            The service account user.
            </value>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClaim.Scope">
            <summary>
            Gets or sets the scope.
            </summary>
            <value>
            The scope.
            </value>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClaim.Audience">
            <summary>
            Gets or sets the token endpoint.
            </summary>
            <value>
            The audience.
            </value>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClaim.ExpiresAt">
            <summary>
            Gets or sets the expected expiration of the token to retrieve.
            </summary>
            <value>
            The expiration UTC timestamp.
            </value>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClaim.IssuedAt">
            <summary>
            Gets or sets the UTC timestamp at which this claim has been built.
            </summary>
            <value>
            The issued UTC timestamp.
            </value>
        </member>
        <member name="T:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowMessage">
            <summary>
            Assertion flow message to be sent to the token endpoint.
            </summary>
        </member>
        <member name="F:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowMessage.GoogleAssertionType">
            <summary>
            Google supported assertion type 
            <see cref="!:https://developers.google.com/accounts/docs/OAuth2ServiceAccount#makingrequest"/>.
            </summary>
        </member>
        <member name="M:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowMessage.#ctor(DotNetOpenAuth.OAuth2.AuthorizationServerDescription)">
            <summary>
            Initializes a new instance of the
            <see cref="T:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowMessage"/> class.
            </summary>
            <param name="authorizationServer">
            Authorization server description.
            </param>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowMessage.GrantType">
            <summary>
            Gets or sets the type of the grant (defaults to "assertion").
            </summary>
            <value>
            The type of the grant.
            </value>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowMessage.AssertionType">
            <summary>
            Gets or sets the type of the assertion (defaults to "http://oauth.net/grant_type/jwt/1.0/bearer").
            </summary>
            <value>
            The type of the assertion.
            </value>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowMessage.Assertion">
            <summary>
            Gets or sets the assertion message.
            </summary>
            <value>
            The assertion.
            </value>
        </member>
        <member name="T:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClient">
            <summary>
            The OAuth2 client for use by applications using Service Accounts or other implementation of the OAuth 2.0
            Assertion Flow.
            </summary>
        </member>
        <member name="M:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClient.#ctor(DotNetOpenAuth.OAuth2.AuthorizationServerDescription,System.Security.Cryptography.X509Certificates.X509Certificate2)">
            <summary>
            Initializes a new instance of the
            <see cref="T:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClient"/> class.
            </summary>
            <param name="authorizationServer">
            Authorization server description.
            </param>
            <param name="certificate">
            Certificate to use to sign the assertion flow messages.
            </param>
        </member>
        <member name="M:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClient.GetState(Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClient)">
            <summary>
            Helper method to retrieve the Authorization State from the 
            <see cref="!:Google.Apis.Authentication.OAuth2.OAuth2Authenticator"/> class.
            </summary>
            <returns>
            The authorization state.
            </returns>
            <param name="provider">
            The provider to use to retrieve the authorization state.
            </param>
        </member>
        <member name="M:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClient.RefreshToken(DotNetOpenAuth.OAuth2.IAuthorizationState,System.Nullable{System.TimeSpan})">
            <summary>
            Request a new access token using the OAuth 2.0 assertion flow.
            </summary>
            <returns>
            Whether or not a new access token has been successfully retrieved.
            </returns>
            <param name='authorization'>
            Object containing the current authorization state.
            </param>
            <param name='skipIfUsefulLifeExceeds'>
            If set to <c>true</c> skip if useful life exceeds.
            </param>
        </member>
        <member name="M:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClient.GenerateMessage">
            <summary>
            Generates the assertion flow message to be sent to the token endpoint.
            </summary>
            <returns>
            The assertion flow message.
            </returns>
        </member>
        <member name="M:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClient.UnpaddedUrlSafeBase64Encode(System.String)">
            <summary>
            Encode the provided UTF8 string into an URL safe base64 string.
            </summary>
            <returns>
            The URL safe base64 string.
            </returns>
            <param name='value'>
            String to encode.
            </param>
        </member>
        <member name="M:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClient.UnpaddedUrlSafeBase64Encode(System.Byte[])">
            <summary>
            Encode the byte array into an URL safe base64 string.
            </summary>
            <returns>
            The URL safe base64 string.
            </returns>
            <param name='bytes'>
            Bytes to encode.
            </param>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClient.ServiceAccountId">
            <summary>
            Gets or sets the service account identifier.
            </summary>
            <value>
            The service account identifier.
            </value>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClient.ServiceAccountUser">
            <summary>
            Gets or sets the service account user (used for domain-wide delegation).
            </summary>
            <value>
            The service account user.
            </value>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClient.Scope">
            <summary>
            Gets or sets the scope to get access for.
            </summary>
            <value>
            The scope.
            </value>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClient.Certificate">
            <summary>
            Gets the certificate used to sign the assertion.
            </summary>
            <value>
            The certificate.
            </value>
        </member>
        <member name="P:Google.Apis.Authentication.OAuth2.DotNetOpenAuth.AssertionFlowClient.Header">
            <summary>
            Gets or sets the JWT claim's header (defaults to Google's supported values).
            </summary>
            <value>
            The header.
            </value>
        </member>
    </members>
</doc>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) NFocus Consulting Inc
United States United States
I'm a Senior Software Developer with King Memory LLC in Columbus, OH working primarily in C# writing APIs and other line of business applications. I've been working in .Net since version 1.0 and I am skilled in most aspects of the platform. I've started out as an Automation Engineer working with robots, lasers, machine vision, and other cool stuff which I miss. I've also worked in healthcare and digital marketing. I speak fluent binary.

On the side I own Aerial Break Software under which I publish personal projects and hope to make some money... someday.

My fun job is shooting Fireworks professionally as an Ohio licensed fireworks exhibitor. I'm licensed for outdoor and indoor fireworks and I've been on the crew for Red, White, and Boom in Columbus, OH since 2002.

Comments and Discussions