Example #1
0
        public void VerifyClassInitialization()
        {
            var serviceInfo = new MicrosoftAccountServiceInfo();

            Assert.AreEqual(AccountType.MicrosoftAccount, serviceInfo.AccountType, "Unexpected account type.");
            Assert.AreEqual(Constants.Authentication.MicrosoftAccountAuthenticationServiceUrl, serviceInfo.AuthenticationServiceUrl, "Unexpected authentication service URL.");
            Assert.AreEqual(string.Format(Constants.Authentication.OneDriveConsumerBaseUrlFormatString, "v1.0"), serviceInfo.BaseUrl, "Unexpected base URL.");
            Assert.AreEqual(Constants.Authentication.MicrosoftAccountSignOutUrl, serviceInfo.SignOutUrl, "Unexpected sign out URL.");
            Assert.AreEqual(Constants.Authentication.MicrosoftAccountTokenServiceUrl, serviceInfo.TokenServiceUrl, "Unexpected token service URL.");
        }
        public Task<ServiceInfo> GetServiceInfo(AppConfig appConfig, CredentialCache credentialCache, IHttpProvider httpProvider)
        {
            var microsoftAccountServiceInfo = new MicrosoftAccountServiceInfo
            {
                AppId = appConfig.MicrosoftAccountAppId,
                ClientSecret = appConfig.MicrosoftAccountClientSecret,
                CredentialCache = credentialCache,
                HttpProvider = httpProvider,
                Scopes = appConfig.MicrosoftAccountScopes,
            };

            microsoftAccountServiceInfo.AuthenticationProvider = this.AuthenticationProvider ?? new OnlineIdAuthenticationProvider(microsoftAccountServiceInfo);
            return Task.FromResult<ServiceInfo>(microsoftAccountServiceInfo);
        }
Example #3
0
        public Task <ServiceInfo> GetServiceInfo(AppConfig appConfig, CredentialCache credentialCache, IHttpProvider httpProvider)
        {
            var microsoftAccountServiceInfo = new MicrosoftAccountServiceInfo
            {
                AppId           = appConfig.MicrosoftAccountAppId,
                ClientSecret    = appConfig.MicrosoftAccountClientSecret,
                CredentialCache = credentialCache,
                HttpProvider    = httpProvider,
                Scopes          = appConfig.MicrosoftAccountScopes,
            };

            microsoftAccountServiceInfo.AuthenticationProvider = this.AuthenticationProvider ?? new OnlineIdAuthenticationProvider(microsoftAccountServiceInfo);
            return(Task.FromResult <ServiceInfo>(microsoftAccountServiceInfo));
        }
        public Task<ServiceInfo> GetServiceInfo(AppConfig appConfig, CredentialCache credentialCache, IHttpProvider httpProvider)
        {
            var microsoftAccountServiceInfo = new MicrosoftAccountServiceInfo
            {
                AppId = appConfig.MicrosoftAccountAppId,
                ClientSecret = appConfig.MicrosoftAccountClientSecret,
                CredentialCache = credentialCache,
                HttpProvider = httpProvider,
                ReturnUrl = WebAuthenticationBroker.GetCurrentApplicationCallbackUri().ToString(),
                Scopes = appConfig.MicrosoftAccountScopes,
                WebAuthenticationUi = this.webAuthenticationUi,
            };

            microsoftAccountServiceInfo.AuthenticationProvider = this.AuthenticationProvider ?? new WebAuthenticationBrokerAuthenticationProvider(microsoftAccountServiceInfo);
            return Task.FromResult<ServiceInfo>(microsoftAccountServiceInfo);
        }
Example #5
0
        public Task <ServiceInfo> GetServiceInfo(AppConfig appConfig, CredentialCache credentialCache, IHttpProvider httpProvider)
        {
            var microsoftAccountServiceInfo = new MicrosoftAccountServiceInfo
            {
                AppId               = appConfig.MicrosoftAccountAppId,
                ClientSecret        = appConfig.MicrosoftAccountClientSecret,
                CredentialCache     = credentialCache,
                HttpProvider        = httpProvider,
                ReturnUrl           = WebAuthenticationBroker.GetCurrentApplicationCallbackUri().ToString(),
                Scopes              = appConfig.MicrosoftAccountScopes,
                WebAuthenticationUi = this.webAuthenticationUi,
            };

            microsoftAccountServiceInfo.AuthenticationProvider = this.AuthenticationProvider ?? new WebAuthenticationBrokerAuthenticationProvider(microsoftAccountServiceInfo);
            return(Task.FromResult <ServiceInfo>(microsoftAccountServiceInfo));
        }