Base solution for your next web application
Open Closed

Access API Endpoint in secure way #10732


User avatar
0
SRTMDEV created

Prerequisites

Please answer the following questions before submitting an issue.

  • What is your product version?
    • 8.6.0
  • What is your product type (Angular or MVC)?
    • Angular
  • What is product framework type (.net framework or .net core)?
    • .net core

Hello,

I am looking for solutions where we have a requirement like access the endpoint by generating the custom JWT Token, different from ABP token, using properties like User email, tenantId, and some related to our project.

At present, the endpoint is publicly accessible using the "AbpAllowAnonymous" attributes. The endpoint is publicly accessible regardless of whether we use [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] or [Authorize].

we don't want to use "[AbpAuthorize]" for some Endpoint.

Thanks SG

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

2 Answer(s)
  • User Avatar
    0
    SRTMDEV created

    Hello Team,

    Any suggestions on these contexts?

    Thanks, SG

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @SRTMDEV

    If this is only for a specific endpoint, you can handle it in the AppService/Controller itself. If you want to use this in more than one endpoint, you can define an action filter similar to https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.AspNetCore/AspNetCore/Mvc/Authorization/AbpAuthorizationFilter.cs. You can also create an attribute similar to AbpAuthorize and check this attribute in your new filter and reject access.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)