1.4 KiB
1.4 KiB
Postman gRPC Guide
Use these files with the running Docker Compose stack:
docker compose up --build
Import Gapido Auth gRPC.postman_environment.json into Postman and select it as the active environment.
Create the gRPC Requests
Postman's HTTP collection JSON is not a perfect carrier for executable gRPC requests. Use Gapido Auth gRPC.postman_collection.json as a request reference, then create gRPC requests in Postman with:
- Server URL:
{{grpc_host}} - Proto file:
proto/gapido_auth/generated/auth.proto - Service:
gapido.auth.v1.AuthService
Request Order
RequestOtp
{
"mobile": "{{mobile}}",
"purpose": "{{purpose}}"
}
- Get the OTP.
With local debug mode, open http://localhost:8080, enter the same mobile number, and use Use Debug OTP; or read the Redis key:
debug:sms:last:{{mobile}}
VerifyOtp
{
"mobile": "{{mobile}}",
"code": "{{otp_code}}",
"purpose": "{{purpose}}"
}
Copy access_token and refresh_token from the response into the active Postman environment.
- Protected calls
For UserOnly, AdminOnly, and RevokeRefreshToken, add metadata:
authorization: Bearer {{access_token}}
RefreshToken
{
"refresh_token": "{{refresh_token}}"
}
Refresh rotates the refresh token, so update both token variables after a successful response.