Exemplo n.º 1
0
 /// <summary>
 /// Creates an unauthenticated client for use in Store apps that uses the OnlineIdAuthenticator API for authentication.
 /// </summary>
 /// <param name="appId">The application ID for Microsoft account authentication.</param>
 /// <param name="scopes">The requested scopes for Microsoft account authentication.</param>
 /// <param name="httpProvider">The <see cref="IHttpProvider"/> for sending HTTP requests.</param>
 /// <returns>The <see cref="IOneDriveClient"/> for the session.</returns>
 public static IOneDriveClient GetUniversalClient(
     string[] scopes,
     string returnUrl           = null,
     IHttpProvider httpProvider = null)
 {
     return(OneDriveClientExtensions.GetClientUsingOnlineIdAuthenticator(scopes, returnUrl, httpProvider));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates an unauthenticated client for use in Store apps that uses the OnlineIdAuthenticator API for authentication.
 /// </summary>
 /// <param name="appId">The application ID for Microsoft account authentication.</param>
 /// <param name="scopes">The requested scopes for Microsoft account authentication.</param>
 /// <param name="httpProvider">The <see cref="IHttpProvider"/> for sending HTTP requests.</param>
 /// <param name="promptType">The credential prompt type (show or hide the credential prompt user interface)</param>
 /// <returns>The <see cref="IOneDriveClient"/> for the session.</returns>
 public static IOneDriveClient GetUniversalClient(
     string[] scopes,
     string returnUrl                = null,
     IHttpProvider httpProvider      = null,
     CredentialPromptType promptType = CredentialPromptType.PromptIfNeeded)
 {
     return(OneDriveClientExtensions.GetClientUsingOnlineIdAuthenticator(scopes, returnUrl, httpProvider, promptType));
 }
Exemplo n.º 3
0
        /// <summary>
        /// Creates an authenticated client for use in Store apps that uses the OnlineIdAuthenticator API for authentication.
        /// </summary>
        /// <param name="appId">The application ID for Microsoft account authentication.</param>
        /// <param name="scopes">The requested scopes for Microsoft account authentication.</param>
        /// <param name="httpProvider">The <see cref="IHttpProvider"/> for sending HTTP requests.</param>
        /// <returns>The <see cref="IOneDriveClient"/> for the session.</returns>
        public static async Task <IOneDriveClient> GetAuthenticatedUniversalClient(
            string[] scopes,
            string returnUrl           = null,
            IHttpProvider httpProvider = null)
        {
            var client = OneDriveClientExtensions.GetClientUsingOnlineIdAuthenticator(scopes, returnUrl, httpProvider);
            await client.AuthenticateAsync();

            return(client);
        }