我正在尝试使用windows身份框架开发一个简单的Web服务来验证桌面应用程序的用户,目前我传递的是WindowsIdentity.GetCurrent().Token
通过post变量生成的令牌(它是加密的和ssl'd,Windows身份验证不是给定的选项我们的域的布局和服务器的配置).我正在将令牌传回来并将其转换回来IntPtr
.
我很遗憾如何验证令牌以确保它是由特定的Active Directory(或任何相关的)生成的.我试图在WindowsIdentity
给定令牌的情况下创建一个新实例但是只会导致异常(消息:用于模仿的无效令牌 - 它不能重复).
如果有人能提供任何帮助甚至提示,我将非常感谢,提前谢谢.
我是新手,我正在尝试安装一个简单的hello world应用程序,但它一直返回"NotFound:(404,"路径'/'未找到.")",但我已定义它.
这是我得到的,
在__ init __ .py中
import cherrypy
from HomeNetMain import HomeNetMain
cherrypy.config.update("global.cfg")
#I have tried "" for the script name parm but that doesn't work
cherrypy.tree.mount(HomeNetMain,"/","main.cfg")
cherrypy.engine.start()
cherrypy.quickstart()
Run Code Online (Sandbox Code Playgroud)
在我的另一个文件中
import cherrypy
class HomeNetMain:
@cherrypy.expose
def index(self):
return "Hello World"
Run Code Online (Sandbox Code Playgroud)
我已尝试使用decorator和index.exposed = True无效(子问题是装饰器或index.exposed的首选方法是什么)
global.cfg
[global]
server.socket_host: "127.0.0.1"
server.socket_port: 9080
log.screen: True
log.error_file: "/tmp/cherrypy.error"
log.access_file: "/tmp/cherrypy.access"
Run Code Online (Sandbox Code Playgroud)
main.cfg
[/]
log.screen: True
log.error_file: "/tmp/homenet.error"
log.access_file: "/tmp/homenet.access"
Run Code Online (Sandbox Code Playgroud)
我感谢任何帮助,提前谢谢.
编辑
这是完整的堆栈跟踪
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/CherryPy-3.2.2-py2.7.egg/cherrypy/_cprequest.py", line 656, in respond
response.body …
Run Code Online (Sandbox Code Playgroud) 我是依赖注入模式的新手,我在从容器中获取类的新实例时遇到问题.在tinyioc中解析它只是继续返回相同的实例而不是新实例.现在为代码
public abstract class HObjectBase : Object
{
private string _name = String.Empty;
public string Name
{
get
{
return this._name;
}
set
{
if (this._name == string.Empty && value.Length > 0 && value != String.Empty)
this._name = value;
else if (value.Length < 1 && value == String.Empty)
throw new FieldAccessException("Objects names cannot be blank");
else
throw new FieldAccessException("Once the internal name of an object has been set it cannot be changed");
}
}
private Guid _id = new Guid(); …
Run Code Online (Sandbox Code Playgroud)