小编Onl*_*eEA的帖子

PageHeader中的模板10 AutoSuggestBox

我正在开发一个UWP应用程序,我正在使用Template10汉堡包模板.我想在PageHeader中添加一个AutoSuggestBox,如果我没有设置任何主命令或辅助命令,它可以正常工作.如果我设置了任何命令,则命令和AutoSuggestBox重叠.我所做的是为PageHeader设置一个padding right值,如下所示:

<controls:PageHeader x:Name="pageHeader" Text="Main Page" Padding="0,0,283,0">
    <!--  place stretched, across top  -->
    <RelativePanel.AlignTopWithPanel>True</RelativePanel.AlignTopWithPanel>
    <RelativePanel.AlignLeftWithPanel>True</RelativePanel.AlignLeftWithPanel>
    <RelativePanel.AlignRightWithPanel>True</RelativePanel.AlignRightWithPanel>
    <!--  secondary commands  -->
    <controls:PageHeader.SecondaryCommands>
        <AppBarButton Click="{x:Bind ViewModel.GotoSettings}" Label="Settings" />
        <AppBarButton Click="{x:Bind ViewModel.GotoPrivacy}" Label="Privacy" />
        <AppBarButton Click="{x:Bind ViewModel.GotoAbout}" Label="About" />
    </controls:PageHeader.SecondaryCommands>
</controls:PageHeader>
<AutoSuggestBox Margin="0,8,12,0" Width="270" QueryIcon="Find" PlaceholderText="Search">
    <RelativePanel.AlignRightWithPanel>True</RelativePanel.AlignRightWithPanel>
</AutoSuggestBox>
Run Code Online (Sandbox Code Playgroud)

我的问题是这是建议的做法还是另外一种方式?提前致谢

xaml win-universal-app template10

1
推荐指数
1
解决办法
897
查看次数

SecurityTokenInvalidAudienceException:IDX10214:听众验证失败

我正在使用Identity和Sustainsys.Saml2(用于SAML身份验证)开发ASP.NET Core 2应用程序。我已经在Startup.cs文件中进行了必要的配置。现在,当我运行项目并尝试使用SAML2登录(作为外部登录名)时,输入凭据后出现以下错误:

SecurityTokenInvalidAudienceException:IDX10214:听众验证失败。观众:“ [PII隐藏]”。不匹配:validationParameters.ValidAudience:“ [PII隐藏]”或validationParameters.ValidAudiences:“ [PII隐藏]”。Microsoft.IdentityModel。令牌令牌,TokenValidationParameters验证参数,不包括SecurityToken validatedToken)Sustainsys.Saml2.Saml2P.Saml2Response + d__60.MoveNext()System.Collections.Generic。

我不明白这是什么意思。我想念什么吗?

这是我在启动文件中的内容

services.AddAuthentication()
        .AddSaml2(options => 
        {
            var spOptions = new SPOptions
            {
                EntityId = new EntityId("https://localhost:44373/Saml2"),
                ReturnUrl = new Uri("https://localhost:44373"),
                MinIncomingSigningAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1",                  
            };                

            options.SPOptions = spOptions;
            options.IdentityProviders.Add(new IdentityProvider(new EntityId("https://www.example.com/SSO/SAML/App"), options.SPOptions)
            {
                AllowUnsolicitedAuthnResponse = false,                  
                MetadataLocation = "https://www.example.com/SSO/SAMLMetadata/App",                  
                LoadMetadata = true,                  
            }); 
        });
Run Code Online (Sandbox Code Playgroud)

提前致谢...

c# saml asp.net-core sustainsys-saml2

1
推荐指数
1
解决办法
9702
查看次数