mirror of https://github.com/abpframework/abp.git
24 changed files with 84 additions and 262 deletions
@ -0,0 +1,16 @@ |
|||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
|
||||
|
namespace OpenIddict.Demo.Server.Controllers; |
||||
|
|
||||
|
[ApiController] |
||||
|
[Authorize] |
||||
|
[Route("api/claims")] |
||||
|
public class ClaimsController : Controller |
||||
|
{ |
||||
|
[HttpGet] |
||||
|
public JsonResult Get() |
||||
|
{ |
||||
|
return Json(User.Claims.Select(x => new {Type = x.Type, Value = x.Value})); |
||||
|
} |
||||
|
} |
||||
@ -1,13 +1,11 @@ |
|||||
using Microsoft.AspNetCore.Authentication; |
using Microsoft.AspNetCore.Authentication; |
||||
using Microsoft.AspNetCore.Builder; |
using OpenIddict.Validation.AspNetCore; |
||||
|
|
||||
namespace Volo.Abp.OpenIddict.Jwt; |
namespace Microsoft.AspNetCore.Builder; |
||||
|
|
||||
//TODO: Should we move this to another package..?
|
public static class ApplicationBuilderAbpOpenIddictMiddlewareExtension |
||||
|
|
||||
public static class JwtTokenMiddleware |
|
||||
{ |
{ |
||||
public static IApplicationBuilder UseJwtTokenMiddleware(this IApplicationBuilder app, string schema = "Bearer") |
public static IApplicationBuilder UseAbpOpenIddictValidation(this IApplicationBuilder app, string schema = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme) |
||||
{ |
{ |
||||
return app.Use(async (ctx, next) => |
return app.Use(async (ctx, next) => |
||||
{ |
{ |
||||
Loading…
Reference in new issue