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 ?

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

5 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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    r.abouzid created

    Hello, I tried using Integration Services, i no longer get the authorization error. However, the client, after receiving the gRPC response, raises the exception :

    Grpc.Core.RpcException
      HResult=0x80131500
      Message=Status(StatusCode="Internal", Detail="Failed to deserialize response message. The response header contains a gRPC status of OK, which means any message returned to the client for this call should be ignored. A unary or client streaming gRPC call must have a response message, which makes this response invalid.")
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share a test project to reproduce this error?

    liming.ma@volosoft.com Thanks

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 21, 2026, 06:18
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.