aspnet-contrib

How to specify the destination for an existing ClaimsIdentity?

浪子不回头ぞ 提交于 2019-11-27 07:05:12
问题 I'm using below code to create a ClaimIdentity in OpenIdConnectServerProvider.AuthorizationProvider. But the identity.Name is not searlized. How to allow the OpenIdConnectServer serarlize the name? Thanks. The previous question is here How to create a ClaimIdentity in asp.net 5 var user = await userManager.FindByNameAsync(context.UserName); var factory = context.HttpContext.RequestServices.GetRequiredService<IUserClaimsPrincipalFactory<ApplicationUser>>(); var identity = await factory

Validating Tokens Issued by AspNet.Security.OpenIdConnect.Server (ASP.NET vNext)

纵然是瞬间 提交于 2019-11-27 04:35:17
问题 I am using Visual Studio 2015 Enterprise and ASP.NET vNext Beta8 to build an endpoint that both issues and consumes JWT tokens. I Originally approached this by generating the tokens myself, as described here. Later a helpful article by @Pinpoint revealed that AspNet.Security.OpenIdConnect.Server (a.k.a. OIDC) can be configured to issue and consume the tokens for me. So I followed those instructions, stood up an endpoint, and by submitting an x-www-form-urlencoded post from postman I receive

How to handle expired access token in asp.net core using refresh token with OpenId Connect

大城市里の小女人 提交于 2019-11-26 16:44:19
问题 I have configured an ASOS OpenIdConnect Server using and an asp.net core mvc app that uses the "Microsoft.AspNetCore.Authentication.OpenIdConnect": "1.0.0 and "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0". I have tested the "Authorization Code" workflow and everything works. The client web app processes the authentication as expected and creates a cookie storing the id_token, access_token, and refresh_token. How do I force Microsoft.AspNetCore.Authentication.OpenIdConnect to request