![]() |
|
||||||||||
|
|||||||
|
|
« Предыдущая тема | Следующая тема » |
| Опции темы | Опции просмотра |
|
![]() |
![]() |
|
|
|
|||||
|
Регистрация: Nov 2008
Сообщений: 5
|
Народ, помогите, пожалуйста.
Хочу сделать логин форму с помощью Flex. Использую томкат. есть login.mxml Цитата:
Цитата:
Цитата:
|
|
|||||
|
Регистрация: May 2006
Адрес: Нск
Сообщений: 91
|
хм, мож я чего-то не понял, а это авторизация в чем?
|
|
|||||
|
Modus ponens
|
А что такое j_security_check или, вернее, http://localhost:8080/blablabla/j_security_check ?
EDIT: Упс, сорри, нашел, что это... тут: http://www.junlu.com/msg/4401.html Ну, чесно, вряд ли смогу помочь... как предположение, а что вы получаете если пробуете авторизироваться с ХТМЛ страницы?
__________________
Hell is the possibility of sanity Последний раз редактировалось wvxvw; 20.11.2008 в 17:20. |
|
|||||
|
Регистрация: Nov 2008
Сообщений: 5
|
Using authentication to control access to Flex applications
To use authentication to prevent unauthorized access to your Flex application, you typically use the container to set up constraints on resources. You then challenge the user who then submits credentials. These credentials determine the success or failure of the user's login attempt, as the container's authentication logic determines. For example, you can protect the page that the Flex application is returned with, or protect the SWF file itself. You do this in the web.xml file by defining specific URL patterns, as the following example shows: <web-app>
<security-constraint>
<web-resource-collection>
<web-resource-name>Payroll Application</web-resource-name>
<url-pattern>/payroll/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>manager</role-name>
</auth-constraint>
</security-constraint>
</web-app>
With BASIC authentication, the user enters a username and password in a popup box that the browser creates. To specify that an application uses BASIC authentication, you use the login-config element and its auth-method subelement in the web application's web.xml file, as the following example shows: <web-app>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Managers</realm-name>
</login-config>
...
</web-app>
When you configure FORM authentication, you can specify both a login form and an error form in the web.xml file, as the following example shows: <web-app>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.htm</form-login-page>
<form-error-page>/loginerror.htm</form-error-page>
</form-login-config>
</login-config>
</web-app>
A simple HTML-based form might appears as follows: <form method="POST" action="j_security_check">
<table>
<tr><td>User</td><td><input type=text name="j_username"></tr>
<tr><td>Password</td><td><input type=password name="j_password"></tr>
</table>
<input type=submit>
</form>
After it is complete, the container populates the browser's security context and provides or denies access to the resource. Flash Player inherits the security context of the underlying browser. As a result, when you make a data service call, the established credentials are used. When a user fails an authentication attempt with invalid credentials, be sure not to return information about which item was incorrect. Instead, use a generic message such as "Your login information was invalid." For application-server specific information about using custom authentication with LiveCycle Data Services, you can use the examples in flex_install_dir/resources/security. Я написал свою логин-форму на флексе, но она не работает, если же использовать код, который написан в примере(написать например с логин форму с помощью html или jsp), все работает прекрасно. j_security_check - это стандартный экшин в томкате. Последний раз редактировалось etc; 21.11.2008 в 22:38. |
|
|||||
|
Регистрация: Nov 2008
Сообщений: 5
|
или быть может кто-нить поможет, как перевесть на язык flex-а данный кусок кода:
Последний раз редактировалось etc; 21.11.2008 в 22:38. |
|
|||||
|
Регистрация: May 2006
Адрес: Нск
Сообщений: 91
|
ну со спринг секьюрити такие манипуляции вроде нормально проходят, вот тут статейка , причем вроде код с вашим схож. я хз конечно, но в самом томкате (настройках и т.д.) проблем быть не может?
|
|
|||||
|
Et cetera
Регистрация: Sep 2002
Сообщений: 30,787
|
Billy_bon, в первом посте вы не поленились оформить код соответствующими тегами, а в последующих что-то с вами случилось. Почему?
|
|
|||||
|
Регистрация: Nov 2008
Сообщений: 5
|
Вроде все настроил сам не знаю как, но вроде завелось. Теперь появилась следующая проблема.
web.xml <!-- Default login configuration uses form-based authentication --> <login-config> <auth-method>FORM</auth-method> <form-login-config> <form-login-page>/login.swf</form-login-page> <form-error-page>/errorLogin.html</form-error-page> </form-login-config> </login-config> Пытался поправить web.xml(вместо login.swf написать login.html, который генерируется из swf html-wrapper-ом с помощью build.xml) <!-- Default login configuration uses form-based authentication --> <login-config> <auth-method>FORM</auth-method> <form-login-config> <form-login-page>/login.html</form-login-page> <form-error-page>/errorLogin.html</form-error-page> </form-login-config> </login-config> Цитата:
![]() Повторюсь login.html - создался с помощью строчки в Build.xml Цитата:
<login-config> <auth-method>BASIC</auth-method> <realm-name>Please, login</realm-name> </login-config> ![]() Заранее спасибо |
![]() |
![]() |
Часовой пояс GMT +4, время: 07:15. |
|
|
« Предыдущая тема | Следующая тема » |
|
|