Open Closed

Authorization for gRPC calls on microservices #8581


User avatar
0
r.abouzid created
  • Template: microservice
  • Created ABP Studio Version: 0.9.5
  • UI Framework: angular
  • Theme: leptonx
  • Theme Style: system
  • Database Provider: ef
  • Database Management System: sqlserver
  • Mobile Framework: maui
  • Public Website: Yes
  • Exception message and full stack trace: 401 : Unauthorized
  • Steps to reproduce the issue: following this article : https://abp.io/docs/commercial/latest/startup-templates/microservice/using-grpc#contributors-section

Hello, I'm working on a project based on the microservices' template, when I implement the gRPC for the inter services communication, the authorization : [Authorize(IdentityPermissions.Users.Create)] blocks me when I call the service from the client µS, 401, Unauthorized. How can I solve this problem with best practices ?


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Have you added the Authorization header with Bearer {access_token} for your request?

    Please share your code using grpc

    Thanks.

  • User Avatar
    0
    r.abouzid created

    I want to bypass the authorization for all the calls via gRPC, from the µservices, and keep the authorization for the external calls coming from the Gateway.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    For internal calls between microservices, you can use integration-services, which does not require authorization.

    For application services you have to pass authorization state(token)

    https://abp.io/docs/latest/framework/api-development/integration-services https://abp.io/docs/latest/tutorials/modular-crm/part-06

Made with ❤️ on ABP v9.1.0-preview. Updated on January 02, 2025, 07:06