Archived
1
0

Development 2

This commit is contained in:
Michael Gordeev
2018-06-30 16:07:32 +03:00
parent 0782f9a506
commit 7a98044484
+6 -9
View File
@@ -26,8 +26,7 @@ namespace FoxTube
{
#region Static Information
public static NetworkCredential EmailCredential { get => new NetworkCredential("youwillneverknowthisadress@gmail.com", "thisisthepassword12345"); }
private static string YoutubeApi { get => "AIzaSyBgHrCnrlzlVmk0cJKL8RqP9Y8x6XSuk_0"; }
private static string ApplicationName { get => "FoxTube"; }
public static SecretsVault Vault { get => Methods.MainPage.Vault; }
private static ClientSecrets Secrets
{
get => new ClientSecrets()
@@ -36,14 +35,14 @@ namespace FoxTube
ClientSecret = "BkVZOAaCU2Zclf0Zlicg6y2_"
};
}
public static bool IsAuthorized { get => Methods.MainPage.Vault.IsLoged; }
public static bool IsAuthorized { get => Vault.IsLoged; }
public static YouTubeService NoAuthService
{
get => new YouTubeService(new BaseClientService.Initializer()
{
ApiKey = YoutubeApi,
ApplicationName = ApplicationName
ApiKey = "AIzaSyBgHrCnrlzlVmk0cJKL8RqP9Y8x6XSuk_0",
ApplicationName = "FoxTube"
});
}
@@ -51,8 +50,8 @@ namespace FoxTube
{
get => new YouTubeService(new BaseClientService.Initializer()
{
HttpClientInitializer = Methods.MainPage.Vault.Credential,
ApplicationName = ApplicationName
HttpClientInitializer = Vault.Credential,
ApplicationName = "FoxTube"
});
}
#endregion
@@ -70,8 +69,6 @@ namespace FoxTube
public async Task Authorize()
{
Credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(Secrets, new[] { Google.Apis.Oauth2.v2.Oauth2Service.Scope.UserinfoProfile, YouTubeService.Scope.YoutubeForceSsl }, "user", CancellationToken.None);
AuthorizationStateChanged.Invoke(this, null);
}