【问题标题】:Restlet User AuthenticationRestlet 用户身份验证
【发布时间】:2013-03-01 17:21:10
【问题描述】:

我对 Restlet 比较陌生,所以目前我正在尝试使用 Restlet 2.1,我想添加用户身份验证

我目前正在使用 Apache ReverseProxy,并计划将其用作 SSL 代理,所以我可能会在 Apache 上加密/解密,Restlet 将得到纯文本

我发现了有关使用 Restlet ChallengeAuthentication 的说法,但在 2.1 API 文档上找不到它,而且由于 Restlet 刚刚更新了他们的网站,大多数 Url 都被破坏了

所以如果有人能给我一些关于如何构建它的指南或者给我一些示例的功能链接,那就太好了,例如: 如何检查身份验证,

如何检测 cookie,

如何设置安全 cookie,

我如何从那个加密的 cookie 中读取数据

还有另一个设计问题,我是否会更好地使用一个尝试为身份验证解密的函数,而不是将 cookie 数据实际存储在像 Redis 这样的数据库中?

提前致谢!

【问题讨论】:

    标签: apache cookies ssl restlet authentication


    【解决方案1】:

    我在 GAE 上使用 2.1.2 restlet 进行了身份验证。 以下代码可以帮助您如何在 restlet 中提供身份验证

    ChallengeAuthenticator guard = new ChallengeAuthenticator(getContext().createChildContext(), ChallengeScheme.HTTP_BASIC,"Your application."); 
    MapVerifier verifier = new MapVerifier();  
    verifier.getLocalSecrets().put(userName, password.toCharArray());
    guard.setVerifier(verifier);
    guard.setNext(this);
    guard.setNext(anyclass.class);
    router.attach("/v1", guard);
    

    这个链接http://restlet.org/learn/tutorial/2.1/ 了解更多关于restlet的信息。

    【讨论】:

      猜你喜欢
      • 2016-11-16
      • 1970-01-01
      • 2014-09-13
      • 1970-01-01
      • 2016-04-12
      • 2014-03-20
      • 1970-01-01
      • 2019-07-24
      • 1970-01-01
      相关资源
      最近更新 更多