AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 26.04.2012, 00:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
ax-erp: Storing passwords using AX
Источник: http://microsoft-dynamics-ax-erp.blo...-using-ax.html
==============


If you need to store passwords in AX there are some application objects, classes and attributes that you can use. This post details the steps you can take to allow entry of a password in a form, which will be stored in the database.

1. Add the password field to your table. This field should be of type ‘CryptoBlob’ which is a container that contains binary data:

2. Add an edit method for the password to your table:

01//BP Deviation Documented
02edit Password editPassword(boolean _set = false, Password _pwd = '')
03{
04 CryptoBlob cryptoBlob = connull();
05 ;
06
07 if (_set)
08 {
09 this.Password = WinapiServer::cryptProtectData(str2cryptoblob(_pwd));
10 }
11
12 return (this.Password == connull()) ? '' : 'xxxxxxxx';
13}


3. Drag and drop the edit method to your form and ensure that the attribute ‘PasswordStyle’ is set to ‘Yes’:

4. To retrieve the password you will need a method similar to the following:

1static Password getPassword(UserId _userId)
2{
3 CryptoBlob cryptoBlob = TutorialPasswordTable::find(_userId).Password;
4 ;
5
6 return (cryptoBlob == connull()) ? '' :
7 cryptoblob2str(WinapiServer::cryptUnProtectData(cryptoBlob));
8}



Disclaimer / Notice / Yada Yada
The safest way to handle passwords is not to store them in the database. The steps described in this post are better than storing the password in the database as plain text, but far from bulletproof. Please ensure that AX security is fully considered if using this method (Table level security, access to code / development etc)




Источник: http://microsoft-dynamics-ax-erp.blo...-using-ax.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
dynamics-ax: A Guide to Microsft Dynamics Cloud ERP - Dynamics AX Blog bot DAX Blogs 0 15.04.2011 00:12
axinthefield: Dynamics AX Event IDs Blog bot DAX Blogs 0 01.03.2011 22:11
daxdilip: Whats New in Dynamics AX 2012 (A brief extract from the recently held Tech Conf.) Blog bot DAX Blogs 7 31.01.2011 12:35
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра
Комбинированный вид Комбинированный вид

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 23:07.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.