久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

GoogleWebAuthorizationBroker.AuthorizeAsync 掛起

GoogleWebAuthorizationBroker.AuthorizeAsync Hangs(GoogleWebAuthorizationBroker.AuthorizeAsync 掛起)
本文介紹了GoogleWebAuthorizationBroker.AuthorizeAsync 掛起的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我們的網站需要從后面的代碼(asp.net mvc 應用程序)上傳視頻到youtube.我正在嘗試獲取 google 憑據,但是當我調用 AuthorizeAsync 時,應用程序只是掛起.我四處尋找解決方案,但似乎沒有任何幫助.我已經在谷歌和堆棧溢出上搜索過明顯的.我發現的大部分內容都提到該應用程序可能無法訪問 appdata 文件夾,因此我嘗試將該文件夾更改為位于 c 驅動器、d 驅動器和實際 inetpub 位置中.我測試并發現我能夠讓應用程序寫入這些位置.

Our website needs to upload videos to youtube from the code behind (asp.net mvc application). I'm trying to get the google credentials, but when i call the AuthorizeAsync, the application just hangs. I've looked all over for a solution and none seem to help out. I've already searched for the obvious on google and stack overflow. most of what i found mentioned that the application might not have access the the appdata folder, so i tried changing the folder to be in the c drive, d drive and in the actual inetpub location. i tested and found i was able to have the application write to those locations.

更具體地說,用戶是我們的管理員,客戶上傳視頻給我們,管理員批準.當管理員批準它們時,它會發布在我們的 youtube 帳戶上.管理員無需執行任何操作,只需單擊批準"按鈕即可.

to be more specific, the user is our admin, customers upload videos to us, and the admin approves them. when the admin approves them, it is posted on our youtube account. the admin should not have to do anything but click the approve button.

為了使這成為一個實際問題,我該怎么做才能通過 AuthorizeAsync?如果您需要更多信息,請告訴我

To make this an actual question, what can i do to get past the AuthorizeAsync? Let me know if you need more info

        UserCredential credential;
        GoogleWebAuthorizationBroker.Folder = "YouTube.Auth.Store";
        using (var stream = new FileStream(CredentialsPath, FileMode.Open,
                             FileAccess.Read))
        {
            credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
                GoogleClientSecrets.Load(stream).Secrets,
                // This OAuth 2.0 access scope allows an application to upload files to the
                // authenticated user's YouTube channel, but doesn't allow other types of access.
                new[] { YouTubeService.Scope.YoutubeUpload },
                "user",
                CancellationToken.None,
                new FileDataStore("YouTube.Auth.Store")
            ).Result;
        }

推薦答案

找到了解決這個問題的方法.

Found a way to get passed this.

我改用了 GoogleAuthorizationCodeFlow.結果是這樣的:

I used GoogleAuthorizationCodeFlow instead. this is what it turned out to look like:

        ClientSecrets secrets = new ClientSecrets()
        {
            ClientId = CLIENT_ID,
            ClientSecret = CLIENT_SECRET
        };

        var token = new TokenResponse { RefreshToken = REFRESH_TOKEN }; 
        var credentials = new UserCredential(new GoogleAuthorizationCodeFlow(
            new GoogleAuthorizationCodeFlow.Initializer 
            {
                ClientSecrets = secrets
            }), 
            "user", 
            token);

        var service = new YouTubeService(new BaseClientService.Initializer()
        {
            HttpClientInitializer = credentials,
            ApplicationName = "TestProject"
        });

這篇關于GoogleWebAuthorizationBroker.AuthorizeAsync 掛起的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

LINQ to SQL and Concurrency Issues(LINQ to SQL 和并發問題)
Yield return from a try/catch block(try/catch 塊的收益回報)
Should I call Parameters.Clear when reusing a SqlCommand with a transation?(重用帶有事務的 SqlCommand 時,我應該調用 Parameters.Clear 嗎?)
what does a using statement without variable do when disposing?(處理時不帶變量的 using 語句有什么作用?)
Why doesn#39;t TransactionScope work with Entity Framework?(為什么 TransactionScope 不適用于實體框架?)
How to dispose TransactionScope in cancelable async/await?(如何在可取消的 async/await 中處理 TransactionScope?)
主站蜘蛛池模板: 色一情一乱一伦一区二区三区 | 国产精品免费一区二区三区 | 成人伊人| 免费在线观看一区二区三区 | 亚洲视频一区在线 | 97人人澡人人爽91综合色 | 国产精品久久久久久久久久久久久 | 2019天天干天天操 | 国产精品18久久久久久久 | 亚洲综合视频 | 91国内视频在线 | 一区二区在线 | 中文字幕国产精品 | 91精品一区| 欧美网址在线观看 | 免费看国产一级特黄aaaa大片 | 欧美成人h版在线观看 | 久久精品国产免费 | 国产9 9在线 | 中文 | 81精品国产乱码久久久久久 | 国产精品日韩 | 成人夜晚看av | 欧美精品在欧美一区二区少妇 | 欧美久久精品一级黑人c片 91免费在线视频 | 国产成人免费 | 免费黄色大片 | 久久国产99| 中文字幕一区二区三区在线观看 | 国内精品视频在线观看 | 亚洲一区二区三区免费视频 | 成人免费在线观看 | 天天操,夜夜爽 | 91在线观看视频 | 久久久久久久久久久久一区二区 | 一区二区三区国产好 | 欧美一区 | 一区二区福利视频 | 国产视频精品视频 | 久久91 | 国产重口老太伦 | 久久成人国产精品 |