小编Pra*_*lot的帖子

使用ASP.NET标识重置密码时令牌无效

我通过复制VS 2013模板中的代码在我的MVC应用程序中实现了ASP.NET Identity.基本的事情是工作,但我无法使重置密码工作.当我显示"忘记密码"页面时,会生成一个包含令牌的电子邮件.该方法返回此标记:

UserManager.GeneratePasswordResetTokenAsync(user.Id)
Run Code Online (Sandbox Code Playgroud)

当我点击链接时,重置密码表单打开,让用户输入他们的电子邮件地址和新密码.然后调用更改密码功能:

UserManager.ResetPasswordAsync(user.Id, model.Code, model.Password);
Run Code Online (Sandbox Code Playgroud)

这看起来对我很好,但结果总是"无效令牌",我不明白为什么会这样.

有没有人知道它为什么不起作用?地狱存储在哪里?我以为它必须在AspNetUsers桌子周围的数据库中......

asp.net-mvc

18
推荐指数
2
解决办法
1万
查看次数

错误:"invalid_grant",描述:"无效的JWT:令牌必须是一个短期令牌并且在合理的时间范围内",Uri:""

我试图在谷歌服务帐户的帮助下访问谷歌日历,但我得到了belloing错误

Google.Apis.dll中出现"Google.Apis.Auth.OAuth2.Responses.TokenResponseException"类型的例外,但未在用户代码中处理

我得到的错误: "invalid_grant", Description:"Invalid JWT: Token must be a short-lived token and in a reasonable timeframe", Uri:""

        string credPath = "key path";

        String serviceAccountEmail = xxxx@developer.gserviceaccount.com";

        var certificate = new X509Certificate2(credPath, "notasecret", X509KeyStorageFlags.Exportable);

        ServiceAccountCredential credential = new ServiceAccountCredential(
           new ServiceAccountCredential.Initializer(serviceAccountEmail)
           {
               Scopes = new[] {  CalendarService.Scope.CalendarReadonly,
                                CalendarService.Scope.Calendar}
           }.FromCertificate(certificate));

        // Create the service.
        var service = new CalendarService(new BaseClientService.Initializer()
        {
            HttpClientInitializer = credential,
            ApplicationName = "HRTool",
        });


        var events = service.Events.List("my calaender id").Execute();
Run Code Online (Sandbox Code Playgroud)

google-calendar-api

2
推荐指数
1
解决办法
5614
查看次数

从dynamo数据库中的两个表获取数据

我在.net中使用dynamo db(无sql)

我有两张桌子正在咆哮

  1. 项目(项目编号,项目名称)
  2. 类别(类别 ID、类别名称、项目 ID)

所以我想访问 { itemid ,itemname,categoryid,categoryname)

以及我如何创建表结构。

请帮我。

.net amazon-web-services amazon-dynamodb

1
推荐指数
1
解决办法
2757
查看次数