令牌始终无效

时间:2019-07-15 19:33:44

标签: spring-boot spring-security spring-data jwt

在一个Spring Boot反应项目中,我尝试使用r2dbc添加jwt的安全性

using System;
using System.ComponentModel;
using System.Windows.Forms;

namespace WindowsFormsApp
{
    public class DaftarBarang
    {
        public string Nama { get; set; }
        public int Harga { get; set; }
    }

    public class TheUserControl : UserControl
    {
        private readonly BindingList<DaftarBarang> list = new BindingList<DaftarBarang>();

        public TheUserControl()
        {
            var grid = new DataGridView
            {
                DataSource = new BindingSource(list, null)
            };

            AutoSize = true;
            Controls.Add(grid);
        }

        public void AddItem(DaftarBarang barang)
        {
            list.Add(barang);
        }
    }

    public class TheForm : Form
    {       
        public TheForm()
        {
            var uc = new TheUserControl();
            uc.AddItem(new DaftarBarang { Nama = "Sepatu olahraga", Harga = 255000 });
            uc.AddItem(new DaftarBarang { Nama = "Baju cantik", Harga = 85000 });

            Controls.Add(uc);
         }
    }

    static class Program
    {
        [STAThread]
        static void Main()
        {
            Application.Run(new TheForm());
        }
    }
}

我尝试用这条线与curl连接

  

卷曲-X POST本地主机:8889 /授权-u管理员:123

我在调试中看到然后validateToken收到:WRtaW46cGVybWFjb24 =

  

捕获的错误是:MalformedJwtException

不明白为什么

如果我尝试直接致电/ users(不应该增加安全性),我会得到

  

卷曲-X GET http://localhost:8889/users

我明白了

  

错误:SEVERITY_LOCALIZED =错误,SEVERITY_NON_LOCALIZED =错误,   CODE = 42601,MESSAGE =“。”或附近的语法错误,POSITION = 12,   FILE = scan.l,LINE = 1128,ROUTINE = scanner_yyerror

0 个答案:

没有答案