{"id":278789,"date":"2016-04-21T16:30:06","date_gmt":"2016-04-21T12:30:06","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=278789"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=278789","title":{"rendered":"\u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 Arduino \u0441 RFID"},"content":{"rendered":"<p>       <a href=\"https:\/\/habrahabr.ru\/company\/intersystems\/blog\/279893\/\"><img decoding=\"async\" height=\"200\" alt=\"Arduino\" title=\"Arduino\" src=\"https:\/\/habrastorage.org\/files\/8f7\/b06\/a6e\/8f7b06a6e43640d99569c80c3e0496fb.jpg\" align=\"left\"\/><\/a><\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0412 <a href=\"https:\/\/habrahabr.ru\/company\/intersystems\/blog\/273749\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Arduino, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u044f. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u0439\u0434\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u2014 \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e RFID \u043a\u0430\u0440\u0442 \u0438 Arduino \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 InterSystems Cach\u00e9.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/h2>\n<p>  \u0412 Cach\u00e9 \u0435\u0441\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <a href=\"http:\/\/docs.intersystems.com\/cache20161\/csp\/docbook\/DocBook.UI.Page.cls?KEY=GCAS_delegated\">\u0434\u0435\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/a> \u2014 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c\u0443 \u043a\u043e\u0434\u0443. \u0427\u0442\u043e\u0431\u044b \u0435\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c, \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ol>\n<li>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u0440\u0443\u0442\u0438\u043d\u0435 ZAUTHENTICATE. \u0423 \u043d\u0435\u0451 \u0435\u0441\u0442\u044c 4 \u0442\u043e\u0447\u043a\u0438 \u0432\u0445\u043e\u0434\u0430: \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043d\u0430\/\u043f\u0430\u0440\u043e\u043b\u044f, \u0438\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432, \u0441\u043c\u0435\u043d\u0430 \u043f\u0430\u0440\u043e\u043b\u044f, \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u0430. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0438\u0436\u0435.\n<\/li>\n<li>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 Cach\u00e9 (SMP \u2192 System Administration \u2192 Security \u2192 System Security \u2192 Authentication\/CSP Session Options, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0444\u043b\u0430\u0433 Allow Delegated authentication \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438).\n<\/li>\n<li>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 (SMP \u2192 Menu \u2192 Manage Services \u2192 \u0421\u0435\u0440\u0432\u0438\u0441 \u2192 Allowed Authentication Methods \u2192 \u0432\u044b\u0431\u0440\u0430\u0442\u044c Delegated \u2192 Save) \u0438\/\u0438\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 (SMP \u2192 Menu \u2192 Manage Web Applications \u2192 \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2192 Allowed Authentication Methods \u2192 \u0432\u044b\u0431\u0440\u0430\u0442\u044c Delegated \u2192 Save).<\/li>\n<\/ol>\n<p>  <\/p>\n<h2>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/h2>\n<p>  \u0412\u043e\u0442 \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u0438\u043b\u0438 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438: <\/p>\n<ol>\n<li>\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0443\u0442\u0438\u043d\u0430 ZAUTHENTICATE. \u041a\u043e\u0434 \u044d\u0442\u043e\u0439 \u0440\u0443\u0442\u0438\u043d\u044b \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u044b\u043c Cach\u00e9 ObjectScript \u043a\u043e\u0434\u043e\u043c, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 <a href=\"http:\/\/docs.intersystems.com\/cache20161\/csp\/docbook\/DocBook.UI.Page.cls?KEY=RCOS_fzf-1#RCOS_B78412\">$ZF<\/a> \u0432\u044b\u0437\u043e\u0432\u044b.\n<\/li>\n<li>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0431\u044b\u043b \u043b\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u043c \u0432\u044b\u0437\u043e\u0432 ZAUTHENTICATE:\n<ul>\n<li>\u0415\u0441\u043b\u0438 \u0432\u044b\u0437\u043e\u0432 ZAUTHENTICATE \u0443\u0441\u043f\u0435\u0448\u0435\u043d \u0438 \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 ZAUTHENTICATE, \u0442\u043e \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0442\u0438\u043f\u0430 \u201cDelegated user\u201d. \u0415\u0441\u043b\u0438 ZAUTHENTICATE \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u0440\u0430\u0432\u0430 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043e\u043d\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.\n<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0432\u044b\u0437\u043e\u0432 ZAUTHENTICATE \u0443\u0441\u043f\u0435\u0448\u0435\u043d \u0438 \u044d\u0442\u043e \u043d\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 ZAUTHENTICATE, \u0442\u043e \u0435\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f.\n<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0432\u044b\u0437\u043e\u0432 ZAUTHENTICATE \u043d\u0435 \u0443\u0441\u043f\u0435\u0448\u0435\u043d, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u044b\u0434\u0430\u0451\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430.\n<\/li>\n<\/ul>\n<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0434\u0432\u0443\u0445\u0444\u0430\u043a\u0442\u043e\u0440\u043d\u0430\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f, \u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0438\u0441\u043a \u043d\u043e\u043c\u0435\u0440\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430. \u0415\u0441\u043b\u0438 \u043e\u043d\u0438 \u0437\u0430\u0434\u0430\u043d\u044b, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0434\u0432\u0443\u0445\u0444\u0430\u043a\u0442\u043e\u0440\u043d\u0430\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u2014 \u044e\u0437\u0435\u0440 \u043d\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f.\n<\/li>\n<li>\u0414\u0435\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/li>\n<\/ol>\n<p>  <\/p>\n<h2>\u041e\u0442\u043a\u0443\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438?<\/h2>\n<p>  \u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e \u043a\u0430\u043a\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\/\u0441\u0435\u0440\u0432\u0438\u0441\u0430:<\/p>\n<ul>\n<li>Delegated \u2014 \u0438\u043c\u044f\/\u043f\u0430\u0440\u043e\u043b\u044c \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0438\u0437 GetCredentials, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 ZAUTHENTICATE (\u0442\u0438\u043f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u2014 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439).\n<\/li>\n<li>Delegated \u0438 Password \u2014 \u0438\u043c\u044f\/\u043f\u0430\u0440\u043e\u043b\u044c \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0438\u0437 GetCredentials, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c\u0438 Cach\u00e9 (\u0442\u0438\u043f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u2014 Cach\u00e9).<\/li>\n<\/ul>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044e \u0440\u0443\u0442\u0438\u043d\u044b ZAUTHENTICATE \u0438 \u0435\u0451 \u0442\u043e\u0447\u0435\u043a \u0432\u0445\u043e\u0434\u0430.<\/p>\n<h2>ZAUTHENTICATE<\/h2>\n<p>  \u042d\u0442\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0440\u0443\u0442\u0438\u043d\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0430\u044f 4 \u0442\u043e\u0447\u043a\u0438 \u0432\u0445\u043e\u0434\u0430.<\/p>\n<h4>\u258dGetCredentials<\/h4>\n<p>  \u042d\u0442\u0430 \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0438 \u043e\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043b\u043e\u0433\u0438\u043d\u0430\/\u043f\u0430\u0440\u043e\u043b\u044f \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041a\u043e\u0434 \u044d\u0442\u043e\u0439 \u0440\u0443\u0442\u0438\u043d\u044b \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c (\u043b\u044e\u0431\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c). \u0412\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 (\u0432\u043d\u0435 \u044d\u0442\u043e\u0439 \u0440\u0443\u0442\u0438\u043d\u044b) \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u0431\u0443\u0434\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438\u0445 \u0432\u0432\u0451\u043b \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e. \u041c\u0435\u0442\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043d\u0430 \u0438 \u043f\u0430\u0440\u043e\u043b\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u2014 \u0432\u0432\u043e\u0434 \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b, API, \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u2014 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e RFID \u043a\u0430\u0440\u0442\u044b. <\/p>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0443\u0441, \u0438 \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430, \u0442\u043e \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0432 \u0430\u0443\u0434\u0438\u0442, \u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0430. \u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u2014 \u043e\u0448\u0438\u0431\u043a\u0430 $SYSTEM.Status.Error($$$GetCredentialsFailed), \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0430\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u043b\u043e\u0433\u0438\u043d\/\u043f\u0430\u0440\u043e\u043b\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c Cach\u00e9. \u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f:<\/p>\n<pre><code>GetCredentials(ServiceName, Namespace, Username, Password, Credentials) Public { }<\/code><\/pre>\n<p>  \u0413\u0434\u0435:<\/p>\n<ul>\n<li>ServiceName \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0434\u0451\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/li>\n<li>Namespace \u2014 \u043e\u0431\u043b\u0430\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438<\/li>\n<li>Username \u2014 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <\/li>\n<li>Password \u2014 \u043f\u0430\u0440\u043e\u043b\u044c<\/li>\n<li>Credentials \u2014 \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f<\/li>\n<\/ul>\n<p>  \u041e\u0442\u043c\u0435\u0447\u0443 \u0432\u0430\u0436\u043d\u0443\u044e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0432\u0445\u043e\u0434\u0430. \u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430\/\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e \u043f\u0430\u0440\u0435 \u043b\u043e\u0433\u0438\u043d\/\u043f\u0430\u0440\u043e\u043b\u044c (Password Authentication), \u0442\u043e \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 GetCredentials, \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e \u043f\u0430\u0440\u043e\u043b\u044e.<\/p>\n<h4>\u258dZAUTHENTICATE<\/h4>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u0430, ZAUTHENTICATE \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0440\u043e\u043b\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u043f\u0435\u0440\u0432\u0430\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u043a\u043e\u0434\u0435 \u0440\u0443\u0442\u0438\u043d\u044b \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 Properties. \u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430:<\/p>\n<pre><code>ZAUTHENTICATE(ServiceName, Namespace, Username, Password, Credentials, Properties) Public { } <\/code><\/pre>\n<p>  \u041c\u0430\u0441\u0441\u0438\u0432 Properties: <\/p>\n<ul>\n<li>Properties(&quot;Comment&quot;) \u2014 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439<\/li>\n<li>Properties(&quot;FullName&quot;) \u2014 \u0438\u043c\u044f \u0438 \u0444\u0430\u043c\u0438\u043b\u0438\u044f <\/li>\n<li>Properties(&quot;NameSpace&quot;) \u2014 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c <\/li>\n<li>Properties(&quot;Roles&quot;) \u2014 \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u043e\u043b\u0435\u0439 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e<\/li>\n<li>Properties(&quot;Routine&quot;) \u2014 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u044f \u0440\u0443\u0442\u0438\u043d\u0430<\/li>\n<li>Properties(&quot;Password&quot;) \u2014 \u043f\u0430\u0440\u043e\u043b\u044c<\/li>\n<li>Properties(&quot;Username&quot;) \u2014 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/li>\n<li>Properties(&quot;PhoneNumber&quot;) \u2014 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/li>\n<li>Properties(&quot;PhoneProvider&quot;) \u2014 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 <\/li>\n<li>Properties(&quot;AutheEnabled&quot;) \u2014 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0434\u0432\u0443\u0445\u0444\u0430\u043a\u0442\u043e\u0440\u043d\u0443\u044e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e (\u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0434\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0440\u0430\u0432\u043d\u043e\u0435 $$$AutheTwoFactorSMS)<\/li>\n<\/ul>\n<p>  <\/p>\n<h4>\u258dChangePassword<\/h4>\n<p>  \u0422\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u0441\u043c\u0435\u043d\u044b \u043f\u0430\u0440\u043e\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f: <\/p>\n<pre><code>ChangePassword(Username, NewPassword, OldPassword, Status) Public { }<\/code><\/pre>\n<p>  \u0413\u0434\u0435:<\/p>\n<ul>\n<li>NewPassword \u2014 \u043d\u043e\u0432\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c<\/li>\n<li>OldPassword \u2014 \u0441\u0442\u0430\u0440\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c<\/li>\n<li>Status \u2014 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f<\/li>\n<\/ul>\n<p>  <\/p>\n<h4>\u258dSendTwoFactorToken <\/h4>\n<p>  \u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0434\u0432\u0443\u0445\u0444\u0430\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u0442\u043e\u043a\u0435\u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430:<\/p>\n<pre><code>SendTwoFactorToken(Username, ServiceName,Namespace,Application,Credentials,SecurityToken,TwoFactorTimeout,UserPhoneNumber) Public { }<\/code><\/pre>\n<p>  \u0413\u0434\u0435:<\/p>\n<ul>\n<li>Application \u2014 CSP \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0440\u0443\u0442\u0438\u043d\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c<\/li>\n<li>SecurityToken \u2014 \u0442\u043e\u043a\u0435\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e<\/li>\n<li>TwoFactorTimeout \u2014 \u0432\u0440\u0435\u043c\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u0430<\/li>\n<li>UserPhoneNumber \u2014 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440<\/h2>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043a\u0430\u0436\u0443 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 Cach\u00e9 \u0432 Windows \u2014 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 %Service_Console, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0412\u043a\u043b\u044e\u0447\u0438\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0440\u0443\u0442\u0438\u043d\u0443 ZAUTHENTICATE (\u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 %SYS):<\/p>\n<pre><code>ZAUTHENTICATE(ServiceName, Namespace, Username, Password, Credentials, Properties) PUBLIC { \t#Iinclude %occErrors \t#Include %occStatus \tQuit $$$OK }  GetCredentials(ServiceName, Namespace, Username, Password, Credentials) Public { \t#Include %occErrors \t#Include %occStatus \t \tDo ##class(%Prompt).GetString(&quot;USER:&quot;,.Username) \tDo ##class(%Prompt).GetString(&quot;PASS:&quot;,.Password)\t \tQuit $$$OK  }<\/code><\/pre>\n<p>  \u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043e\u0431\u044b\u0447\u043d\u043e\u043c\u0443 \u043b\u043e\u0433\u0438\u043d\u0443.<\/p>\n<pre><code>&gt;USER: _SYSTEM &gt;PASS: SYS<\/code><\/pre>\n<p>  <\/p>\n<h2>RFID<\/h2>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 RFID. \u0418\u0434\u0435\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u2014 \u0438\u0437 Cach\u00e9 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043d\u0430 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0443, \u0430 \u043f\u0440\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u043c \u0435\u0451 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0431\u0435\u0440\u0451\u043c \u0441\u0445\u0435\u043c\u0443 \u0438\u0437 Arduino Uno \u0438 \u043c\u043e\u0434\u0443\u043b\u044f RFID-RC522:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/67e\/468\/4b4\/67e4684b41e641d691257e363d941e94.png\"\/><\/p>\n<p>  \u0412\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430 \u0421, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/miguelbalboa\/rfid\">MF522<\/a> (\u0442\u0430\u043c \u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0430\u0441\u043f\u0438\u043d\u043e\u0432\u043a\u0430 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 Arduino). \u041e\u043d \u043f\u043e COM \u043f\u043e\u0440\u0442\u0443 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 2 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<ul>\n<li>Get \u2014 \u043f\u043e \u043d\u0435\u0439 \u043d\u0430 com \u043f\u043e\u0440\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0431\u043b\u043e\u043a\u043e\u0432 RFID \u043a\u0430\u0440\u0442\u044b 2, 4, 5, 6<\/li>\n<li>Set@bloc2@bloc4@bloc5@bloc6 \u2014 \u043f\u043e \u043d\u0435\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0431\u043b\u043e\u043a\u043e\u0432 2, 4, 5, 6 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u043d\u0430 C<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;SPI.h&gt; \/\/include the SPI bus library #include &lt;MFRC522.h&gt; \/\/include the RFID reader library  #define SS_PIN 10  \/\/slave select pin #define RST_PIN 9  \/\/reset pin  #define u1b 2  \/\/Block on a card for user1 byte array #define u2b 4  \/\/Block on a card for user2 byte array #define p1b 5  \/\/Block on a card for pass1 byte array #define p2b 6  \/\/Block on a card for pass2 byte array  MFRC522 mfrc522(SS_PIN, RST_PIN);        \/\/ instatiate a MFRC522 reader object. MFRC522::MIFARE_Key key; \/\/create a MIFARE_Key struct named 'key', which will hold the card information  byte readbackblock[18]; \/\/This array is used for reading out a block. The MIFARE_Read method requires a buffer that is at least 18  String inString = &quot;&quot;; \/\/ COM port incoming data buffer  void setup() {   Serial.begin(9600);        \/\/ Initialize serial communications with the PC   SPI.begin();               \/\/ Init SPI bus   mfrc522.PCD_Init();        \/\/ Init MFRC522 card (in case you wonder what PCD means: proximity coupling device)   \/\/ Serial.println(&quot;Scan a MIFARE Classic card&quot;);    \/\/ Prepare the security key for the read and write functions - all six key bytes are set to 0xFF at chip delivery from the factory   \/\/ Since the cards in the kit are new and the keys were never defined, they are 0xFF   \/\/ if we had a card that was programmed by someone else, we would need to know the key to be able to access it.    \/\/ This key would then need to be stored in 'key' instead.    for (byte i = 0; i &lt; 6; i++) {     key.keyByte[i] = 0xFF; \/\/ keyByte is defined in the &quot;MIFARE_Key&quot; 'struct' definition in the .h file of the library   } }  void loop() {   \/\/ put your main code here, to run repeatedly:   \/\/ Receive data from com port   while (Serial.available() &gt; 0) {     int inChar = Serial.read();      if (inChar != '\\n') {       inString += (char)inChar;      } else {       \/\/ New line       while (!initCard()); \/\/ connect to an RFID card       String Action = inString.substring(0, 3);       if (Action == &quot;Set&quot;) {         \/\/ Write login and pass into the card         setUserAndPassToCard(inString);       } else if (Action == &quot;Get&quot;) {         \/\/ Read login and pass from the card         readUserAndPassToCom();       } else {         Serial.println(Action);       }              disconnectCard(); \/\/ disconnect RFID card       inString = &quot;&quot;;     }   } }  \/\/\/ Read blocks with user\/pass info and output the to COM port: \/\/\/ user1user2@pass1pass2 void readUserAndPassToCom() {   readBlockToCom(u1b);   readBlockToCom(u2b);   Serial.write(&quot;@&quot;);   readBlockToCom(p1b);   readBlockToCom(p2b);   Serial.println(&quot;&quot;); }  \/\/\/ Set user\/pass info into a card \/\/\/ Data: Set@user1@user2@pass1@pass2 \/\/\/ Data sample: Set@1234567890123456@1234567890123456@1234567890123456@1234567890123456 void setUserAndPassToCard(String Data) {   \/\/ Serial.println(Data);   byte user1[16], user2[16], pass1[16], pass2[16];    String user1str = inString.substring(4, 20);   String user2str = inString.substring(21, 37);   String pass1str = inString.substring(38, 54);   String pass2str = inString.substring(55, 71);    stringToArray(user1str, user1, sizeof(user1));   stringToArray(user2str, user2, sizeof(user2));   stringToArray(pass1str, pass1, sizeof(pass1));   stringToArray(pass2str, pass2, sizeof(pass2));    writeBlock(u1b, user1); \/\/ u1b is the block number, user1 is the block content   writeBlock(u2b, user2);   writeBlock(p1b, pass1);   writeBlock(p2b, pass2);      Serial.println(&quot;Done&quot;); }  void stringToArray(String str, byte array[], int arrlength) {   for (int j = 0 ; j &lt; arrlength ; j++)   {     array[j] =  str.charAt(j);   } }  bool initCard() {   \/\/ Look for new cards (in case you wonder what PICC means: proximity integrated circuit card)   if ( ! mfrc522.PICC_IsNewCardPresent()) {\/\/if PICC_IsNewCardPresent returns 1, a new card has been found and we continue     return false; \/\/if it did not find a new card is returns a '0' and we return to the start of the loop   }    \/\/ Select one of the cards   if ( ! mfrc522.PICC_ReadCardSerial()) {\/\/if PICC_ReadCardSerial returns 1, the &quot;uid&quot; struct (see MFRC522.h lines 238-45)) contains the ID of the read card.     return false; \/\/if it returns a '0' something went wrong and we return to the start of the loop   }   return true; }  void disconnectCard() {   \/\/ Halt PICC   mfrc522.PICC_HaltA();   \/\/ Stop encryption on PCD   mfrc522.PCD_StopCrypto1(); }  void readBlockToCom(int number) {   readBlock(number, readbackblock);\/\/read the block back   for (int j = 0 ; j &lt; 16 ; j++) \/\/print the block contents   {     Serial.write (readbackblock[j]);\/\/Serial.write() transmits the ASCII numbers as human readable characters to serial monitor   } }  int writeBlock(int blockNumber, byte arrayAddress[]) {   \/\/ this makes sure that we only write into data blocks. Every 4th block is a trailer block for the access\/security info.   int largestModulo4Number = blockNumber \/ 4 * 4;   int trailerBlock = largestModulo4Number + 3; \/\/determine trailer block for the sector   if (blockNumber &gt; 2 && (blockNumber + 1) % 4 == 0) {     Serial.print(blockNumber);  \/\/block number is a trailer block (modulo 4); quit and send error code 2     Serial.println(&quot; is a trailer block:&quot;);     return 2;   }   \/\/Serial.print(blockNumber);   \/\/Serial.println(&quot; is a data block:&quot;);    \/*****************************************authentication of the desired block for access***********************************\/   byte status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, trailerBlock, &key, &(mfrc522.uid));   \/\/ byte PCD_Authenticate(byte command, byte blockAddr, MIFARE_Key *key, Uid *uid);   \/\/ this method is used to authenticate a certain block for writing or reading   \/\/ command: See enumerations above -&gt; PICC_CMD_MF_AUTH_KEY_A\t= 0x60 (=1100000),\t\t   \/\/ this command performs authentication with Key A   \/\/ blockAddr is the number of the block from 0 to 15.   \/\/ MIFARE_Key *key is a pointer to the MIFARE_Key struct defined above, this struct needs to be defined for each block.    \/\/ New cards have all A\/B= FF FF FF FF FF FF   \/\/ Uid *uid is a pointer to the UID struct that contains the user ID of the card.   if (status != MFRC522::STATUS_OK) {     Serial.print(&quot;PCD_Authenticate() failed: &quot;);     Serial.println(mfrc522.GetStatusCodeName(status));     return 3;\/\/return &quot;3&quot; as error message   }   \/\/ it appears the authentication needs to be made before every block read\/write within a specific sector.   \/\/ If a different sector is being authenticated access to the previous one is lost.    \/*****************************************writing the block***********************************************************\/    status = mfrc522.MIFARE_Write(blockNumber, arrayAddress, 16);   \/\/valueBlockA is the block number, MIFARE_Write(block number (0-15), byte array containing 16 values, number of bytes in block (=16))   \/\/ status = mfrc522.MIFARE_Write(9, value1Block, 16);   if (status != MFRC522::STATUS_OK) {     Serial.print(&quot;MIFARE_Write() failed: &quot;);     Serial.println(mfrc522.GetStatusCodeName(status));     return 4;\/\/return &quot;4&quot; as error message   }   \/\/Serial.println(&quot;block was written&quot;); }  int readBlock(int blockNumber, byte arrayAddress[]) {   int largestModulo4Number = blockNumber \/ 4 * 4;   int trailerBlock = largestModulo4Number + 3; \/\/determine trailer block for the sector    \/*****************************************authentication of the desired block for access********************************************\/   byte status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, trailerBlock, &key, &(mfrc522.uid));   \/\/ byte PCD_Authenticate(byte command, byte blockAddr, MIFARE_Key *key, Uid *uid);   \/\/ this method is used to authenticate a certain block for writing or reading   \/\/ command: See enumerations above -&gt; PICC_CMD_MF_AUTH_KEY_A\t= 0x60 (=1100000),\t\t   \/\/ this command performs authentication with Key A   \/\/ blockAddr is the number of the block from 0 to 15.   \/\/ MIFARE_Key *key is a pointer to the MIFARE_Key struct defined above, this struct needs to be defined for each block.    \/\/ New cards have all A\/B= FF FF FF FF FF FF   \/\/ Uid *uid is a pointer to the UID struct that contains the user ID of the card.   if (status != MFRC522::STATUS_OK) {     Serial.print(&quot;PCD_Authenticate() failed (read): &quot;);     Serial.println(mfrc522.GetStatusCodeName(status));     return 3;\/\/return &quot;3&quot; as error message   }   \/\/ it appears the authentication needs to be made before every block read\/write within a specific sector.   \/\/ If a different sector is being authenticated access to the previous one is lost.    \/*****************************************reading a block***********************************************************\/    byte buffersize = 18;\/\/we need to define a variable with the read buffer size, since the MIFARE_Read method below needs a pointer to the variable that contains the size...   status = mfrc522.MIFARE_Read(blockNumber, arrayAddress, &buffersize);\/\/&buffersize is a pointer to the buffersize variable; MIFARE_Read requires a pointer instead of just a number   if (status != MFRC522::STATUS_OK) {     Serial.print(&quot;MIFARE_read() failed: &quot;);     Serial.println(mfrc522.GetStatusCodeName(status));     return 4;\/\/return &quot;4&quot; as error message   } }<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041a\u043b\u0430\u0441\u0441 Arduino.Delegate, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 2 \u0442\u043e\u0447\u043a\u0438 \u0432\u0445\u043e\u0434\u0430:<\/p>\n<ul>\n<li>SetCredentials \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u0448\u0438\u0444\u0440\u0443\u0435\u0442 \u0438\u0445 AES \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u044e\u0447\u0430 \u0445\u0440\u0430\u043d\u044f\u0449\u0435\u0433\u043e\u0441\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 RFID \u043a\u0430\u0440\u0442\u0443.\n<\/li>\n<li>GetCredentials \u2014 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0448\u0438\u0444\u0440\u043e\u0442\u0435\u043a\u0441\u0442 \u0441 \u043a\u0430\u0440\u0442\u044b \u0438 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0435\u0433\u043e, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u043b\u043e\u0433\u0438\u043d, \u043f\u0430\u0440\u043e\u043b\u044c \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Arduino.Delegate<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>\/\/\/ Delegated Authentication with Arduino. \/\/\/ Installation steps:&lt;br&gt; \/\/\/ 1. Connect arduino (and upload C code from Delegated.ino there)&lt;br&gt; \/\/\/ 2. Make this class visible in %SYS namespace (import there or map pckage)&lt;br&gt; \/\/\/ 3. Set SerialPort parameter to a correct value and recompile the class&lt;br&gt; \/\/\/ 4. Run &lt;example&gt;Do ##class(Arduino.Delegated).InitEncryption(Key, IV)&lt;\/example&gt; \/\/\/ 5. Write encrypted user credentials to RFID card  with SetCredentials&lt;br&gt; \/\/\/ 6. Import ZAUTHENTICATE into %SYS&lt;br&gt; \/\/\/ 7. Enable Delegated and password auth for relevant services and\/or apps Class Arduino.Delegated [ Abstract ] {  Parameter SerialPort As %String = &quot;com3&quot;;  \/\/\/ Creates managed encryption key.&lt;br&gt; \/\/\/ key - Input key material. \/\/\/ Key material 16, 24, or 32 characters long (on Unicode systems, with all character values &lt; 256) is used directly. \/\/\/ Otherwise, Password-Based Key Derivation Function #2 (PBKDF2) \/\/\/ is used with HMAC-SHA-1, \/\/\/ no salt, and one iteration \/\/\/ to generate an AES key of the next larger valid size (up to 32 bytes). \/\/\/ (See RSA Laboratories Public-Key Cryptography Standards #5 for more information.) \/\/\/ &lt;br&gt;&lt;br&gt; \/\/\/ IV - Initialization vector (optional). \/\/\/ If this argument is present it must be 16 characters long (on Unicode systems, with all character values &lt; 256). \/\/\/ If this argument is omitted (or is an empty string), a null initialization vector is used. \/\/\/ &lt;br&gt; \/\/\/ &lt;example&gt;Do ##class(Arduino.Delegated).Init(&quot;&quot;, &quot;&quot;)&lt;\/example&gt; ClassMethod Init(Key As %String, IV As %String) { \tNew $Namespace \tSet $Namespace = &quot;%SYS&quot; \tSet ^Arduino(&quot;Key&quot;)= Key \tSet ^Arduino(&quot;IV&quot;)= IV }  \/\/\/ Send Arduino the command to set credentials on a card to Username\/Password (encrypted) \/\/\/ &lt;example&gt;Do ##class(Arduino.Delegated).SetCredentials(&quot;_SYSTEM&quot;, &quot;SYS&quot;)&lt;\/example&gt; ClassMethod SetCredentials(Username As %String(MAXLEN=15), Password As %String(MAXLEN=15)) As %Status { \t \tSet Status = $$$OK \t \tSet CipherUsername = ..EncryptText(Username) \tSet CipherPassword = ..EncryptText(Password) \t \tSet User1 = $Extract(CipherUsername, 1, 16) \t \tSet User2 = $Extract(CipherUsername, 17, 32) \tSet User2 = ..AppendToString(User2, , 16) \t \tSet Pass1 = $Extract(CipherPassword, 1, 16) \t \tSet Pass2 = $Extract(CipherPassword, 17, 32) \tSet Pass2 = ..AppendToString(Pass2, , 16) \t \tSet CommandList = $ListBuild(&quot;Set&quot;, User1, User2, Pass1, Pass2) \tSet Command = $ListToString(CommandList, &quot;@&quot;)  \tSet Status = ..ExecuteCommand(.Command) \tIf (Status = &quot;Done&quot;) { \t\tSet Status = $$$OK \t} Else { \t\tSet Status = $$$ERROR($$$GeneralError, &quot;SetCredentials failure, received: &quot; _ Status)  \t} \t \tReturn Status }  \/\/\/ Connect to an Arduino device, receive credentials, decode them and set to Username\/Password variables. \/\/\/ &lt;example&gt;do ##class(Arduino.Delegated).GetCredentials(.Username, .Password)&lt;\/example&gt; ClassMethod GetCredentials(Output Username As %String, Output Password As %String) As %Status { \tKill Username, Password \tSet Username = &quot;&quot; \tSet Password = &quot;&quot; \tSet Status = $$$OK \t \tSet Credentials = ..ExecuteCommand(&quot;Get&quot;) \tIf (($L(Credentials) =65) && ($L(Credentials,&quot;@&quot;) = 2)) { \t\tSet CipherUsername = $Piece(Credentials, &quot;@&quot;, 1) \t\tSet CipherPassword = $Piece(Credentials, &quot;@&quot;, 2) \t\tSet CipherUsername = $Extract(CipherUsername, 1, 24) \/\/ we need only first 24 characters \t\tSet CipherPassword = $Extract(CipherPassword, 1, 24) \t\tSet Username = ..DecryptText(CipherUsername) \t\tSet Password = ..DecryptText(CipherPassword) \t} Else { \t\tSet Status = $$$ERROR($$$GeneralError, &quot;GetCredentials failure, received: &quot; _ Credentials)  \t} \t \tReturn Status }  \/\/\/ Send one line at a time, using common terminating characters (i.e., CR) and receive output \/\/\/ Possible comands:&lt;br&gt; \/\/\/ &lt;b&gt;Get&lt;\/b&gt; - reads an RFID card and returns information in a format: user@pass&lt;br&gt; \/\/\/ &lt;b&gt;Set@user1@user2@pass1@pass2&lt;\/b&gt; - sets information on a RFID card  \/\/\/ in a format: user@pass (where user = user1@user2)&lt;br&gt; \/\/\/ Returns output, produced by Arduino \/\/\/ &lt;example&gt;w ##class(Arduino.Delegated).ExecuteCommand(&quot;Get&quot;)&lt;\/example&gt; ClassMethod ExecuteCommand(ByRef Command As %String, SerialPort = {..#SerialPort}) As %String { \tset x=&quot;&quot; \ttry {         \/\/Parameters used to open the serial device:         \/\/  portstate = &quot; 0801n0&quot; - by byte position:         \/\/      1: space indicates &quot;don't disconnect the port&quot;         \/\/      2: 0 indicates &quot;don't use modem control&quot;         \/\/      3: 8 indicates 8 data bits         \/\/      4: 0 indicates no parity         \/\/      5: 1 indicates one stop bit         \/\/      6: n indicates that flow control is disabled         \/\/      7: 0 indicates disable DTR         \/\/  \/BAUD=9600 determines the baud rate, of course.         open SerialPort:(:::&quot; 0801n0&quot;:\/BAUD=9600)         set old = $io \/\/Keep track of the original device         use SerialPort  \twrite $char(10)         hang 1         write Command _ $Char(10)                  read x \/\/Read until a termination character is reached         use old         close SerialPort            } catch ex {         close SerialPort         w $System.Status.GetErrorText(ex.AsStatus())     }          return x }  \/\/\/ Get key to encode\/decode via EncryptText\/DecryptText ClassMethod GetKey() [ CodeMode = expression ] { $Get(^Arduino(&quot;Key&quot;)) }  \/\/\/ Get IV to encode\/decode via EncryptText\/DecryptText ClassMethod GetIV() [ CodeMode = expression ] { $Get(^Arduino(&quot;IV&quot;)) }  \/\/\/ Encrypt PlainText with AESCBCEncrypt \/\/\/ &lt;example&gt;Write ##class(Arduino.Delegated).EncryptText(&quot;string&quot;)&lt;\/example&gt; ClassMethod EncryptText(PlainText As %String) As %String { \t \tSet Text=$ZConvert(PlainText,&quot;O&quot;,&quot;UTF8&quot;) \tSet Text=$System.Encryption.AESCBCEncrypt(Text, ..GetKey(), ..GetIV()) \tSet Ciphertext=$System.Encryption.Base64Encode(Text) \tReturn Ciphertext }  \/\/\/ Decrypt PlainText with AESCBCEncrypt \/\/\/ &lt;example&gt;Write ##class(Arduino.Delegated).DecryptText(&quot;sFgKzZVle187N4OqhhcXPw==&quot;)&lt;\/example&gt; ClassMethod DecryptText(CipherText As %String) As %String { \tSet Text=$System.Encryption.Base64Decode(CipherText) \tSet Text=$System.Encryption.AESCBCDecrypt(Text, ..GetKey(), ..GetIV()) \tSet PlainText=$ZConvert(Text,&quot;I&quot;,&quot;UTF8&quot;)  \tReturn PlainText }  \/\/\/ Extends right side of a String by Character up to Length chars \/\/\/ &lt;example&gt;Write ##class(Arduino.Delegated).AppendToString(&quot;&quot;)&lt;\/example&gt; ClassMethod AppendToString(String As %String, Character As %String(MAXLEN=1) = &quot;_&quot;, Length As %Integer = {$Length(String)}) As %String { \tSet Difference = Length - $Length(String)   \tReturn:Difference&lt;=0 String \tSet Tail = $Justify(&quot;&quot;, Difference) \tSet Tail = $Translate(Tail, &quot; &quot;, Character) \tReturn String _ Tail }  }<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0420\u0443\u0442\u0438\u043d\u0430 ZAUTHENTICATE, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 Arduino.Delegated, \u043c\u0435\u0442\u043e\u0434 GetCredentials:<\/p>\n<pre><code>ZAUTHENTICATE(ServiceName, Namespace, Username, Password, Credentials, Properties) PUBLIC { \t#Include %occStatus \tQuit $$$OK }  GetCredentials(ServiceName, Namespace, Username, Password, Credentials) Public { \t#Include %occErrors \t#Include %occStatus\t \tQuit ##class(Arduino.Delegated).GetCredentials(.Username, .Password)  }<\/code><\/pre>\n<p>  \u0413\u043e\u0442\u043e\u0432\u043e! \u0421\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/8f7\/b06\/a6e\/8f7b06a6e43640d99569c80c3e0496fb.jpg\"\/><\/p>\n<p>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043a\u043b\u044e\u0447\u0438 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435, \u043e\u0431\u043b\u0430\u0441\u0442\u0438 %SYS (\u0442\u0430\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043a\u043b\u0430\u0441\u0441 Arduino.Delegated):<\/p>\n<pre><code>Do ##class(Arduino.Delegated).InitEncryption(Key, IV)<\/code><\/pre>\n<p>  \u0413\u0434\u0435 Key \u2014 \u043a\u043b\u044e\u0447 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f, IV \u2014 \u0432\u0435\u043a\u0442\u043e\u0440 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043d\u0430 \u0438 \u043f\u0430\u0440\u043e\u043b\u044f. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c Arduino \u043a Cach\u00e9 \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043d\u0430 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code>Do ##class(Arduino.Delegated).SetCredentials(&quot;_SYSTEM&quot;, &quot;SYS&quot;)<\/code><\/pre>\n<p>  \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e Delegated \u0438 Password \u0432 \u043d\u0443\u0436\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445\/\u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0438 \u043c\u043e\u0436\u043d\u043e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0438\u043b\u0438 \u043f\u043e\u0440\u0442\u0430\u043b\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439) \u043f\u043e\u0434\u043d\u043e\u0441\u044f \u043a\u0430\u0440\u0442\u0443 \u043a \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u0435\u043b\u044e RFID \u043a\u0430\u0440\u0442.<\/p>\n<h2>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<ul>\n<li>\u041f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u0443\u0440\u043e\u0432\u043d\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <a href=\"http:\/\/docs.intersystems.com\/cache20161\/csp\/docbook\/DocBook.UI.Page.cls?KEY=GCAS_encrypt#GCAS_encrypt_mgmt\">\u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/a> \u0434\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043d\u0430 \u0438 \u043f\u0430\u0440\u043e\u043b\u044f.\n<\/li>\n<li>\u041f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u0443\u0440\u043e\u0432\u043d\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0432\u0443\u0445\u0444\u0430\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u2014 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043f\u0430\u0440\u0443 \u043b\u043e\u0433\u0438\u043d\/\u043f\u0430\u0440\u043e\u043b\u044c, \u0430 \u043f\u043e\u0442\u043e\u043c \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0443, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043a\u043b\u044e\u0447, \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0417\u0430\u0442\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0432\u0435\u0440\u044f\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0441 \u0442\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <a href=\"https:\/\/community.intersystems.com\/post\/best-practices-store-user-informationsettings-cach%C3%A9\">\u043e\u0431\u0441\u0443\u0436\u0434\u0430\u043b\u0438\u0441\u044c<\/a> \u043d\u0430 Community \u043f\u043e\u0440\u0442\u0430\u043b\u0435 InterSystems.\n<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043d\u0430 \u0438 \u043f\u0430\u0440\u043e\u043b\u044f \u0434\u043b\u0438\u043d\u043d\u0435\u0435 15 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043a\u0430\u0436\u0434\u044b\u0439.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u0412\u044b\u0432\u043e\u0434\u044b<\/h2>\n<p>  \u0413\u0438\u0431\u043a\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 Cach\u00e9 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<h2>\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>  \u00bb <a href=\"http:\/\/docs.intersystems.com\/cache20161\/csp\/docbook\/DocBook.UI.Page.cls?KEY=GCAS_delegated\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a><br \/>  \u00bb <a href=\"https:\/\/github.com\/intersystems-ru\/ArduinoSnippets\">GitHub \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u043a\u043e\u0434\u043e\u043c<\/a> (\u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 SAMPLES \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0443\u0442\u0438\u043d\u044b ZAUTHENTICATE)               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/279893\/\"> https:\/\/habrahabr.ru\/post\/279893\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <a href=\"https:\/\/habrahabr.ru\/company\/intersystems\/blog\/279893\/\"><img decoding=\"async\" height=\"200\" alt=\"Arduino\" title=\"Arduino\" src=\"https:\/\/habrastorage.org\/files\/8f7\/b06\/a6e\/8f7b06a6e43640d99569c80c3e0496fb.jpg\" align=\"left\"\/><\/a><\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0412 <a href=\"https:\/\/habrahabr.ru\/company\/intersystems\/blog\/273749\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Arduino, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u044f. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u0439\u0434\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u2014 \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e RFID \u043a\u0430\u0440\u0442 \u0438 Arduino \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 InterSystems Cach\u00e9.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-278789","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278789","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=278789"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278789\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=278789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=278789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=278789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}