本文整理汇总了C#中IAppBuilder.UseJsonWebToken方法的典型用法代码示例。如果您正苦于以下问题:C# IAppBuilder.UseJsonWebToken方法的具体用法?C# IAppBuilder.UseJsonWebToken怎么用?C# IAppBuilder.UseJsonWebToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAppBuilder
的用法示例。
在下文中一共展示了IAppBuilder.UseJsonWebToken方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Configuration
public void Configuration(IAppBuilder app)
{
// validate JWT tokens from AuthorizationServer
app.UseJsonWebToken(
issuer: Constants.AS.IssuerName,
audience: Constants.Audience,
signingKey: Constants.AS.SigningKey);
app.UseNancy();
}
示例2: ConfigureAuth
private static void ConfigureAuth(IAppBuilder app)
{
// validate JWT tokens from AuthorizationServer
app.UseJsonWebToken(
issuer: "AS",
audience: "sparrow",
signingKey: "OYGY0nAkQUZx1YrT6ler8CI6qbJHyn32tWbCDNuLL+M=");
// claims transformation
app.UseClaimsTransformation(new ClaimsTransformer());
}
示例3: Configuration
public void Configuration(IAppBuilder app)
{
JwtSecurityTokenHandler.InboundClaimTypeMap = ClaimMappings.None;
app.UseJsonWebToken(
issuer: "https://idsrv3.com",
audience: "https://idsrv3.com/resources",
signingKey: X509.LocalMachine.TrustedPeople.SubjectDistinguishedName.Find("CN=idsrv3test", false).First());
app.UseWebApi(WebApiConfig.Register());
}
示例4: Configure
public static void Configure(IAppBuilder app)
{
// no mapping of incoming claims to Microsoft types
JwtSecurityTokenHandler.InboundClaimTypeMap = new Dictionary<string, string>();
// validate JWT tokens from AuthorizationServer
app.UseJsonWebToken(
issuer: Constants.AS.IssuerName,
audience: Constants.Audience,
signingKey: Constants.AS.SigningKey);
// claims transformation
app.UseClaimsTransformation(new ClaimsTransformer());
}
示例5: Configuration
public void Configuration(IAppBuilder app)
{
JwtSecurityTokenHandler.InboundClaimTypeMap = ClaimMappings.None;
app.UseJsonWebToken(
issuer: "https://idsrv3.com",
audience: "https://idsrv3.com/resources",
signingKey: X509.LocalMachine.TrustedPeople.SubjectDistinguishedName.Find("CN=idsrv3test", false).First());
app.UseIdentitiyServerReferenceTokens(new ReferenceTokenValidationOptions
{
TokenValidationEndpoint = "http://localhost:3333/core/connect/accessTokenValidation"
});
app.UseWebApi(WebApiConfig.Register());
}
示例6: Configuration
public void Configuration(IAppBuilder app)
{
// authorization manager
ClaimsAuthorization.CustomAuthorizationManager = new AuthorizationManager();
// no mapping of incoming claims to Microsoft types
JwtSecurityTokenHandler.InboundClaimTypeMap = ClaimMappings.None;
// validate JWT tokens from AuthorizationServer
app.UseJsonWebToken(
issuer: Constants.AS.IssuerName,
audience: Constants.Audience,
signingKey: Constants.AS.SigningKey);
// claims transformation
app.UseClaimsTransformation(new ClaimsTransformer().Transform);
app.UseWebApi(WebApiConfig.Configure());
}