Abha Registration Using Aadhaar Api's returning "Unathorized""

Hi,
I tried to create health id using https://healthidsbx.abdm.gov.in/api/v1/registration/aadhaar/generateOtp
but it returns “Unauthorized”.
I’m using Bearer token generated from https://dev.abdm.gov.in/gateway/v0.5/sessions
using “clientId”: “SBX_001208”.
Could please check my account has appropriate permission to create health Id?
If no such permission then how can I get this permission.

Regards,
Vibhav

@shobhitgunwant, could you please look into this?.
Thank you!

@vibhav.myhealthcare can you please input your auth token in jwt.io and share with us the output for the same. It will clearly display the roles assigned to your client-id.

Hi,
I am also facing the same issue, i.e., the generateOtp API returns “Unauthorized”, using clientId: SBX_002984
Below is the output I get after decode my accessToken in jwt :

{
“exp”: 1679569685,
“iat”: 1679569085,
“jti”: “0987d883-0b19-4614-9448-80ae50409b9f”,
“iss”: “https://dev.ndhm.gov.in/auth/realms/central-registry”,
“aud”: “account”,
“sub”: “3bf88fd3-674e-4827-9145-d2554fe09981”,
“typ”: “Bearer”,
“azp”: “SBX_002984”,
“session_state”: “3743d14a-a775-40cc-81bb-83046519d6d3”,
“acr”: “1”,
“allowed-origins”: [
http://localhost:9007
],
“realm_access”: {
“roles”: [
“hiu”,
“offline_access”,
“healthId”,
“OIDC”,
“hip”
]
},
“resource_access”: {
“SBX_002984”: {
“roles”: [
“uma_protection”
]
},
“account”: {
“roles”: [
“manage-account”,
“manage-account-links”,
“view-profile”
]
}
},
“scope”: “openid email profile”,
“clientId”: “SBX_002984”,
“clientHost”: “10.233.68.60”,
“email_verified”: false,
“preferred_username”: “service-account-sbx_002984”,
“clientAddress”: “10.233.68.60”
}

hi @Arghya.Ubq

please use the correct environment for the postman to test the hid-sbx API

from
Areeb

Hi @Areeb,
There’s only one environment available on the postman collection page.

I also set the appropriate variables and the scripts required to get the values from the responses.
Still, I’m getting the same Unauthorized response.

Please look into the matter.

Thanks

@SARCH1, please find below auth token decoded details from jwt.io

@SARCH1, @shobhitgunwant Could you please look into this? still getting Unauthorized error.
{
“timestamp”: “2023-04-16T12:21:26.825+0000”,
“status”: 401,
“error”: “Unauthorized”,
“message”: “Unauthorized”,
“path”: “/api/v1/registration/aadhaar/generateOtp”
}