appweb官网关于form表单提交的一部分的翻译

Form Authentication
表单认证


The Form authentication scheme uses a web page for the user to enter their username and password. These values are then submitted to Appweb via a Http POST request. Appweb analyzes the username and password, and if authenticated, a login session is created and a cookie is returned to the users's browser. Subsequent requests that include the cookie will be automatically authenticated and served.
表单认证策略常常用一个web页面,这个页面用户可以输入用户名和密码。用户名和密码通过一个HttpPost请求被提交到Appweb服务器。Appweb服务器通过分析用户名和密码,得知如果用户名和密码被认证了,一个登陆session会被建力并且一个cookies返回给用户的浏览器。随后的请求包括cookies将被自动认证和支持

To configure Form authentication, the AuthType directive may take additional arguments to manage the login sequence. The Form variant of AuthType may specify a login web page, a login service URL, a logout service URL,a destination web page once authenticated and a destination page once logged out. The format is:
去配置Form认证,AuthType指令可以获取额外的参数来处理登陆序列。一旦一个目标web页面被认证和注销,表单各种各样的AuthType可以设定一个登陆web页面,一个登陆服务URL,一个注销服务Url,配置格式如下:

AuthType form realm Login-Page Login-Service Logout-Service Logged-In-Destination Logged-Out-Destination

This defines the URLs that are invoked during the login sequence and creates special request routes for these URLs. These routes will permit access to the login page and login service so they can be accessed by unauthenticated users. Each of these AuthType arguments is optional and may be specified as the empty string "" to omit. For example:
这个配置定义了这些URLS,在登录序列和创建特殊的请求路由时被调用,这些路由将允许通过登录页面和登录服务器,因此他们会被未经认证的用户获取。这些AuthType参数中的任何一个都是可选的,而且可以作为省略掉“”的空字符串被认证。例如

<Route ^/>
    AuthType form example.com /public/login.html /login /logout / /public/login.html
</Route>

<Route ^/public/>
    Prefix /public
    Documents public
    AuthType none
</Route>

This example enables Form authentication for all requests and will redirect the client browser to /public/login.html where the user can enter their username and password. The login web page should submit the username and password to the login service bound to the /login URL. When logout is required, the client should submit a HTTP POST request to the logout service bound to the /logout URL.The last two fields in the AuthType directive are the destination URL to which the client's browser will be redirected once logged in and when logged out. The second /public route enables access to documents under the "public" directory without authentication.
这个例子说明在用户输入用户名和密码的任何地方,对所有的请求来说Form认证是可用的,并且将客户端浏览器重定向到/public/login.html 。登录web页面讲通过/login接口提交用户名和密码到登录服务器。 当必须注销的时候,客户端应该通过 /logout接口提交一个HTTPPOST请求到注销服务器。在AuthType指令的以上个领域都是目标URL,这些目标URL表明一旦被登陆和注销的时候客户端的浏览器将被重新传送。第二个/public接口表明有一个通道不用通过认证,直接到静态document,这个静态文件放在public文件夹下面。

Login Service
登陆服务
The Login-Service is URL that is bound to an internal service to receive the username and password and authenticate the user. This service expects the username/password to be submitted via POST data using the input fields "username" and "password". You can supply your own login and logout service by specifying the empty string "" for the Login-Service in the AuthType directive. If using your own Login Service, you should call httpLogin to validate the user against the configured password store.
登陆服务即使一耳光URL,这个URL通过一耳光内部的服务区接收用户名和密码以及用户认证。这个服务期望用户名和密码用"username" 和 "password"命名,然后通过POST方式被提交。在AuthType指令的登录服务中通过验证空字符串,你可以提供你自己的登录和注销服务。如果你用自己的登录服务的话。你应该使用httpLogin去验证用户,这个用户是和已存储的配置密码不一样的

Web Form
Web表单
Here is a minimal example login page:
这里是一个极小的登录的例子

<html><head><title>login.html</title></head>
<body>
    <p>Please log in</p>
    <form name="details" method="post" action="/auth/login">
        Username <input type="text" name="username" value=''><br/>
        Password <input type="password" name="password" value=''><br/>
        <input type="submit" name="submit" value="OK">
    </form>
</body>
</html>

The two submitted fields must be named username and password.If the login attempt succeeds, the client will receive a response including a session cookie and will be redirected to the Destination URL. If the destination URL includes a referrer: prefix and the login request contained a referrer URL in the HTTP header, then that referrer URL will be used as the destination instead of the hard-wired destination.
两个被提交的字段应该被命名为“username”,“password”。如果登录时成功的,客户端将接收到包括一个session cookie的一个响应,并且重定向到目标URL。如果目标URL包括一个引用前缀和在HTTP请求头中包含refferURL的登录请求 。然后这个referrer URL 将被用做目标地址来代替硬链接的目标地址

转载于:https://my.oschina.net/yj1993/blog/1518236

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值