{"id":58960,"date":"2024-03-23T16:30:15","date_gmt":"2024-03-23T15:30:15","guid":{"rendered":"https:\/\/ar3dp.de\/docs\/programmieren\/net-maui-basis-applikation-app-template\/biometrische-authentifizierung\/"},"modified":"2024-03-23T16:30:15","modified_gmt":"2024-03-23T15:30:15","slug":"biometrische-authentifizierung","status":"publish","type":"docs","link":"https:\/\/ar3dp.de\/en\/docs\/programmieren\/net-maui-basis-applikation-app-template\/biometrische-authentifizierung\/","title":{"rendered":"Biometrische Authentifizierung"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Das App-Template bietet die M\u00f6glichkeit der biometrischen Authentifizierung. Diese Funktion kann im Projekt aktiviert werden.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;xml&quot;,&quot;mime&quot;:&quot;application\/xml&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;XML&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;XML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;xml&quot;}\">\t  &lt;!----&gt;&lt;DefineConstants&gt;$(DefineConstants);Biometric&lt;\/DefineConstants&gt;\n\n\n\t  &lt;!-- Needed for biometric authentication --&gt;\n\t  &lt;PackageReference Include=&quot;Oscore.Maui.Biometric&quot; Version=&quot;1.0.1&quot; \/&gt;\n<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"> Danach kann einfach die Content-Ansicht <code>BiometricAuthConventView<\/code> eingebunden werden oder eine eigene Ansicht erstellt werden.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;xml&quot;,&quot;mime&quot;:&quot;application\/xml&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;XML&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;XML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;xml&quot;}\">\n            &lt;contentViews:BiometricAuthConventView\n                Background=&quot;{AppThemeBinding Light={StaticResource White}, Dark={StaticResource OffBlack}}&quot;\n                IsVisible=&quot;{Binding BiometricAuthed, Converter={StaticResource BooleanReverseVisibilityConverter}}&quot;\n                AuthButtonCommand=&quot;{Binding BiometricAuthCommand}&quot;\n                TitleLabelText=&quot;{x:Static localization:Strings.NoteSecuredAreaAuthNeeded}&quot;\n                AuthButtonText=&quot;{x:Static localization:Strings.Authenticate}&quot;\n                &gt;\n                &lt;contentViews:BiometricAuthConventView.Style&gt;\n                    &lt;Style TargetType=&quot;contentViews:BiometricAuthConventView&quot;&gt;\n                        &lt;Setter Property=&quot;IsVisible&quot; Value=&quot;True&quot; \/&gt;\n                        &lt;Style.Triggers&gt;\n                            &lt;DataTrigger\n                                TargetType=&quot;contentViews:BiometricAuthConventView&quot;\n                                Binding=&quot;{Binding BiometricAuthSupported}&quot;\n                                Value=&quot;False&quot;\n                                &gt;\n                                &lt;Setter Property=&quot;IsVisible&quot; Value=&quot;False&quot; \/&gt;\n                            &lt;\/DataTrigger&gt;\n                            &lt;DataTrigger\n                                TargetType=&quot;contentViews:BiometricAuthConventView&quot;\n                                Binding=&quot;{Binding BiometricAuthed}&quot;\n                                Value=&quot;True&quot;\n                                &gt;\n                                &lt;Setter Property=&quot;IsVisible&quot; Value=&quot;True&quot; \/&gt;\n                            &lt;\/DataTrigger&gt;\n                        &lt;\/Style.Triggers&gt;\n                    &lt;\/Style&gt;\n                &lt;\/contentViews:BiometricAuthConventView.Style&gt;\n            &lt;\/contentViews:BiometricAuthConventView&gt;<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Commands<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Die dazugeh\u00f6rigen <code>Commands<\/code> und <code>Properties<\/code> findest du im <code>BaseViewModel<\/code>.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">        [ObservableProperty]\n        bool biometricAuthSupported = true;\n\n        [ObservableProperty]\n        bool resetBiometricAuthOnPageLeave = true;\n\n        [ObservableProperty]\n        bool biometricAuthed = false;\n\n\/\/...\n\n\t\t[RelayCommand]\n\t\tasync Task BiometricAuth()\n\t\t{\n    \t\ttry\n    \t\t{\n        \t\tAuthenticationResult result = await BiometricAuthentication.Current.AuthenticateAsync(new AuthenticationRequest(\n            \t\tStrings.RequestedBiometricAuthHeadline,\n            \t\tStrings.RequestedBiometricAuthContent));\n        \t\tawait DispatchManager.DispatchAsync(Dispatcher, () =&gt; BiometricAuthed = result.Authenticated);\n    \t\t}\n    \t\tcatch (Exception exc)\n    \t\t{\n        \t\tEventManager.Instance.LogError(exc);\n    \t\t}\n\t\t}<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Bitte beachte, dass die Form nur angezeigt werden soll, wenn die Eigenschaft <code>BiometricAuthSupported<\/code> wahr ist.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Das App-Template bietet die M\u00f6glichkeit der biometrischen Authentifizierung. Diese Funktion kann im Projekt aktiviert werden. Danach kann einfach die Content-Ansicht BiometricAuthConventView eingebunden werden oder eine eigene Ansicht erstellt werden. Commands Die dazugeh\u00f6rigen Commands und Properties findest du im BaseViewModel. Bitte beachte, dass die Form nur angezeigt werden soll, wenn die Eigenschaft BiometricAuthSupported wahr ist.<\/p>","protected":false},"author":1,"featured_media":0,"parent":57992,"menu_order":11,"comment_status":"open","ping_status":"closed","template":"","meta":{"_featured":false,"_is_vendor_doc":"0","footnotes":""},"doc_tag":[],"class_list":["post-58960","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/docs\/58960","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/comments?post=58960"}],"version-history":[{"count":2,"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/docs\/58960\/revisions"}],"predecessor-version":[{"id":58971,"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/docs\/58960\/revisions\/58971"}],"up":[{"embeddable":true,"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/docs\/57992"}],"next":[{"title":"Bereitstellen f\u00fcr iOS","link":"https:\/\/ar3dp.de\/en\/docs\/programmieren\/net-maui-basis-applikation-app-template\/bereitstellen-fuer-ios\/","href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/docs\/58318"}],"prev":[{"title":"License Manager","link":"https:\/\/ar3dp.de\/en\/docs\/programmieren\/net-maui-basis-applikation-app-template\/lizenz-manager\/","href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/docs\/58290"}],"wp:attachment":[{"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/media?parent=58960"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/ar3dp.de\/en\/wp-json\/wp\/v2\/doc_tag?post=58960"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}