@IntegrationSupport HPR SBX APIs are giving 401 unauthorised error even though my client id has hp_id role in the gateway.
Here is the request -
curl --location 'https://hpridsbx.abdm.gov.in/api/v1/auth/init' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2ODY4Mjk0MDksImlhdCI6MTY4NjgyODgwOSwianRpIjoiMDVjY2FiNGQtNGI4YS00OTI5LTliMWQtNjIzOWYzMjdmNjY1IiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJkMjg5NzNkOS1iNGI1LTRkNTctYjE3Yy0xZTA2MGE0MzgyN2QiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJTQlhfMDAyNDE5Iiwic2Vzc2lvbl9zdGF0ZSI6IjY2YTgzOTNlLTBkZGYtNGY5OS04YTI2LWQxYmJiNDIyMDViYyIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo5MDA3Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJoZnIiLCJoaXUiLCJvZmZsaW5lX2FjY2VzcyIsImhlYWx0aElkIiwicGhyIiwiT0lEQyIsImhpcCIsImhwX2lkIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiU0JYXzAwMjQxOSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgZW1haWwgcHJvZmlsZSIsImNsaWVudElkIjoiU0JYXzAwMjQxOSIsImNsaWVudEhvc3QiOiIxMC4yMzMuNjcuNDIiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsInByZWZlcnJlZF91c2VybmFtZSI6InNlcnZpY2UtYWNjb3VudC1zYnhfMDAyNDE5IiwiY2xpZW50QWRkcmVzcyI6IjEwLjIzMy42Ny40MiJ9.UpL-WJcEFUb-jh168qz9ixPSj4dWBjCizP6g4UHM8IobUubh9cYW0ubUijvQzPVgw-Rt0N7rUmgZ4-6PhgqBuyzQ6EQi-2U5ItkYRFs0DJdKw8EK3B-zfTtEqzhVBx7OSJWin_1Qho_1_r1oYgNsbpeRNkcTA0xhfb7S5M4DVqlEGIRfviGWqGbxX8US8jPYa3SiyN-X8RmzlWp0ORg1cjYw0QyH7cGO3xMrsHFmna2WRzusVBJJ1K_qD-jUc1bzRpPqanKIn4p2nhmZMytTq-J4jIP4mMQqyULWOWADGXWpWmUzZiUSin73k4djubih0Dp7uNdHvmSqd9tIr6R8DQ' \
--header 'Cookie: HttpOnly; TS0130ddaa=01445fed04c5ec049025e9ec609bc98da773986bd40854ac5e8bb9f2c4a57cfe72ed95fd81d2c19c7751e26b55df831e2a747db549e1cc9f69d2cb26dd0dd97ef7e220d7a3' \
--data-raw '{
"idType": "hpr_id",
"domainName": "@hpr.abdm",
"authMethod": "AADHAAR_OTP",
"hprId": "satwik@hpr.abdm"
}'
My client id is SBX_002419, you can check the roles assigned to my client id in the below output from jwt.io which I got after pasting my access token.
{
"exp": 1686829409,
"iat": 1686828809,
"jti": "05ccab4d-4b8a-4929-9b1d-6239f327f665",
"iss": "https://dev.ndhm.gov.in/auth/realms/central-registry",
"aud": "account",
"sub": "d28973d9-b4b5-4d57-b17c-1e060a43827d",
"typ": "Bearer",
"azp": "SBX_002419",
"session_state": "66a8393e-0ddf-4f99-8a26-d1bbb42205bc",
"acr": "1",
"allowed-origins": [
"http://localhost:9007"
],
"realm_access": {
"roles": [
"hfr",
"hiu",
"offline_access",
"healthId",
"phr",
"OIDC",
"hip",
"hp_id"
]
},
"resource_access": {
"SBX_002419": {
"roles": [
"uma_protection"
]
},
"account": {
"roles": [
"manage-account",
"manage-account-links",
"view-profile"
]
}
},
"scope": "openid email profile",
"clientId": "SBX_002419",
"clientHost": "10.233.67.42",
"email_verified": false,
"preferred_username": "service-account-sbx_002419",
"clientAddress": "10.233.67.42"
}
Is there any problem on your end?