Netty / Shiro整合(Netty / Shiro Integration)

我不想编写自己的身份验证处理程序,而是使用现有的身份验证框架,例如Apache Shiro。 经过一些研究后,我发现将Shiro与netty集成并不是一项直接的任务,尽管沿着通道传递主题不是问题,而是设置所有必需的处理程序。 是否有现有的集成(例如ChannelHandler等)或至少一个公共示例,它显示了如何使用具有典型功能的Shiro验证netty中的HTTP请求(请记住我,主题的cookie存储等)?

最好的问候和感谢提前,Remigius。


Instead of writing my own authentication handler, I'd like to use an existing authentication framework, e.g. Apache Shiro. After some research I have found that integrating Shiro with netty is not a straight forward task, although passing the Subject along the channel is not a problem, but rather setting up all the required handlers. Is there an existing integration (e.g. a ChannelHandler etc.) or at least a public sample that shows how to authenticate HTTP requests in netty with Shiro with the typical features (remember me, cookie store for subject etc.)?

Best regards and thanks in advance, Remigius.


原文:https://stackoverflow.com/questions/28697939
2023-04-06 10:04

满意答案

在Codeproject上发表了一篇文章,描述了您正在寻找的解决方案: 链接

希望这会有所帮助。 Rgds,AB


There is an article published on Codeproject, describing the solution that you are looking for: link

Hope this will help. Rgds, AB

相关问答

更多

如何清除富文本框中的某些内容(how to clear a certain content in a rich text box)

Richtextbox1.text = mid(Richtextbox1.text,1,len(richtextbox1.text)-x)&NewTotal 其中x是前一个总计的长度,NewTotal是新的总字符串。 编辑(见评论): 使用此代码解决您的问题: dim numberofcolumns as integer = listview1.ColumnHeaders.Count dim str(numberofcolumns-1) as string str(numberofcolum...

如何以编程方式启动新的Windows登录会话(RDP或控制台)(How to start a new Windows logon session (RDP or console) programmatically)

我让SendInput在登录桌面上工作(事实证明,UAC安全桌面)。 SetThreadDesktop不能为您提供与最初在目标桌面中启动该进程相同的权限。 因此,当我检测到桌面更改,而不是调用SetThreadDesktop时,我使用CreateProcessAsUser在新桌面中启动了另一个进程。 然后我发信号通知观众切换并关闭当前进程。 I got SendInput to work on the logon desktop (and, as it turns out, the UAC sec...

Shopify在富文本框中添加图像会在添加后显示损坏的图像(Shopify Adding Image in Rich text box shows broken image after adding)

所有图像必须包含img_url才能获取图像本身的CDN路径。 此外,您必须以这种方式定位块图像block.settings.image而不是settings.block.image 。 所以你的代码应该是{{ block.settings.image-left | img_url: '1024x' }} {{ block.settings.image-left | img_url: '1024x' }}或你喜欢它的大小。 All images must include img_url in ord...

如何判断SPField是富文本框还是普通文本框?(How can I tell if an SPField is a rich text box or a normal text box?)

你能使用TypeAsString属性吗? 其他人似乎有找到类型的问题 。 string fieldType = spField.TypeAsString; Can you use the TypeAsString property? Others seem to have had issues finding the type. string fieldType = spField.TypeAsString;

添加启动进程的富文本框的链接(RDP)(Add link to rich text box that starts a process (RDP))

在Codeproject上发表了一篇文章,描述了您正在寻找的解决方案: 链接 希望这会有所帮助。 Rgds,AB There is an article published on Codeproject, describing the solution that you are looking for: link Hope this will help. Rgds, AB

富文本框中多个超链接到多个页面c#(Multiple Hyperlinks to Multiple Pages in rich text box c#)

LinkClickedEventArgs参数e包含一个LinkText属性,该属性是单击的URL - 因此您可以将其用作进程启动调用中的参数。 private void richTextBox1_LinkClicked(object sender, System.Windows.Forms.LinkClickedEventArgs e) { p = System.Diagnostics.Process.Start(e.LinkText); } The LinkClickedEve...

在C#中为富文本框分配内存(Allocating memory for a rich text box in C#)

我认为可能有不同的标签设置(我的意思是一个标签的空格数) Thank you all for your inputs.. Above C++ code uses, 8 bit LPSTR as a buffer. Problem with rich text box is it doesn't support Unicode - 8 bit characters... It supports only - 16 bit characters Instead of a rich text box, ...

如果富文本框具有焦点,如何打开大写锁定(How to turn on caps lock whenever rich text box has focus)

我会建议,而不是捕获关键输入并将其替换为关联的大写版本。 否则,假设用户在文本框中单击,切换到另一个应用程序,实现大写锁定打开,在计算机上抛出一块砖块,然后切换回您的应用程序,并且光标位于文本框中,并等待大写字母,但Caps Lock现在关闭。 I would suggest instead capturing the key input and replacing it with the associated uppercase version. Otherwise, imagine a sit...

C#富文本框样式(C# rich text box styling)

对于要为其应用样式的每个字符串,请选择字符串,然后应用所需的样式。 喜欢: richTextBox1.Text = "Hi this is a string"; richTextBox1.Select(0, 2);//selects Hi richTextBox1.SelectionColor = Color.Red;//make its color red richTextBox1.SelectionFont = new Font("Arial", 15, FontStyle.Bold); ap...

富文本框中的图标?(Icons in rich text box?)

我认为唯一的方法是使用粘贴选项。 试试这个代码 private void richTextBox1_KeyDown(object sender, KeyEventArgs e) { if (richTextBox1.Text.Contains(":-)")) { richTextBox1.SelectionStart = richTextBox1.Find(":-)", RichTextBoxFinds.WholeWord); richTex...

相关文章

更多

快速了解shiro

1.1 什么是shiro Shiro是apache旗下一个开源框架,它将软件系统的安全认证相关的功能 ...

Shiro整合到Web应用

添加了一个新的src/main/webapp/login.jsp文件和一个简单的登录表单以使用它来登录 ...

[Netty 1] 初识Netty

1. 简介 最早接触netty是在阅读Zookeeper源码的时候,后来看到Storm的消息传输层也由 ...

shiro视频教程免费下载

第一天:基于url权限管理 shiro基础,原理知识:对权限管理的理解,什么是权限管理,用户认证,用户 ...

Netty环境配置

netty是一个java事件驱动的网络通信框架,也就是一个jar包,只要在项目里引用即可。

Shiro相关术语

领域领域是可以访问特定于应用程序的安全数据(如用户

Netty开发环境配置

最新版本的Netty 4.x和JDK 1.6及更高版本

Shiro入门示例教程

如果您想要用户在应用程序的当前会话期间使用户可用

第一章 Shiro简介——《跟我学Shiro》

Apache Shiro是Java的一个安全框架。目前,使用Apache Shiro的人越来越多,因为 ...

Netty源码分析

Netty提供异步的、事件驱动的网络应用程序框架和工具,用以快速开发高性能、高可靠性的网络服务器和客户 ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本