我正在摆弄OneDrive API.
在这里找到代码https://github.com/onedrive/onedrive-sdk-csharp
特定于OneDrive Api浏览器.
我没有关于这个特定主题的正规教育(认证).
我想知道,首次登录后如何保持身份验证?也就是说,如果您希望每次都要查询URI的URI,我将如何存储登录信息?
例如,运行OneDrive API Browser解决方案时,您必须在每次运行应用程序时登录.如果我想在某处保存凭据,比如在文本文件中,该怎么办?我该怎么办?(我知道安全问题/那里的不良做法)
我应该在某处保存令牌吗?是否有其他服务可用于长期令牌?它甚至可能吗?是否涉及cookie?
我不确定这里发生了什么,它使用Twitter API进行身份验证就好了.
但当它到达应该发布到Twitter的点时,它会抛出一个StackOverflowException说:
An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll
我很困惑.下面的代码是导致异常并最终导致异常的原因.
void StartValidation()
{
Console.Clear();
//Start Status thread
var status = TextAndUi.GetStatisThread();
status.Start("Validating");
//Check for Messages
var tweetAndSenderData = Imap.GetUnreadMessageAndSender();
if (tweetAndSenderData != null)
{
//Authurize connection and app
var authenticate = new Authenticate();
var tweetApp = authenticate.CreateClient();
//End thread
status.Abort();
Console.WriteLine("Validated!");
Console.Clear();
//Post tweets
PostContent("test", tweetApp);
//Delete messages
Imap.DeleteMessages();
}
else
{
//End thread
status.Abort();
TextAndUi.ShowSomethingToTheUser("The box is empty, or TTT could not secure a …Run Code Online (Sandbox Code Playgroud)