How do i get user auth token (i have to use profile API))

how do i get auth token to use profile API
i am confuse how to get user token
please help @IntegrationSupport

Please clarify if you refer to ABHA profile APIs.

Yes abha profile apis…
like /v1/account/update/phr-address, /v1/account/profile

Kindly use API sequence given below.

1 v1/auth/init Initiate authentication process for Given ABHA Number Auth Method, ABHA Number Txn ID
2a /v1/auth/confirmWithMobileOTP Authentication with OTP OTP, Txn ID X- Token
2b /v1/auth/confirmWithAadhaarOtp Authentication with OTP OTP, Txn ID X-Token
3 v1/account/profile Get Account Information X-Token ABHA profile

hello team,
thanks for replying, i have followed all the steps but in last step i am getting 401 unauthorized
my client id is: “SBX_003189”, can you please check i have all the permissions or any thing i am missing.
below is the token i am getting from 2a step.
“token”: “eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiI5MS01MDg3LTQ0ODEtMDQyNyIsImNsaWVudElkIjoiU0JYXzAwMzE4OSIsInN5c3RlbSI6IkFCSEEtTiIsIm1vYmlsZSI6Ijk5Nzk2MzE4ODMiLCJleHAiOjE2ODQzMTQ5NDksImhlYWx0aElkTnVtYmVyIjoiOTEtNTA4Ny00NDgxLTA0MjciLCJpYXQiOjE2ODQzMTMxNDl9.bRSWP5yKOqfeYo_GCqg-qwqMI4gnkNVY7yn5fpEnZjXoB6sBZx2r4lu2t-QyrnfKOWLf5nU2QuWwsbZPchuezFyL-2ckqczuqEk9YzinF1XL0iBcGfJmYnlBsv5kKT1DZye8PomLYwh1WNPxYC_GUAGgtDCp-TB9CvzXaL6bFVyzOq4kcG-EeB9xAlWDvw6PQu-PjPBgKG4zAIQYqvr0pNqpQwKKTMGLP6IHscjwC0SozDYUO-jcHVt3lud2pYGAciPxL0TzqNIC6zoWdE0Me6QNy4JIZjP696_ePpCT7ssI9J3ndXqe2xAC-PSJ6evFygS_EM43S8lQSOjK0RmS2CwouukQZNVcQkP4z-ETMJZhCYXeSL0dcrDHRfK5aDJ4UsnsLCq_-gxISD8PcIkkKIJ4aIwvujsXv_yODoui1uLMmIOwZMDH-ULaAYDLjqRvGLHfwlM7sXnkYfiqDccNyu4gU5LU-3S71Kk-eNQdBoSj7qKKLeUdLsuNJFfnvkEzgXRB1SKP0k1DNMVWYbftvC8dLXxRdTCgBWva6Bh7ZuG9UHHiVro49Van1A5FFdMJQyD42cBcv0PUjqJyLZhxU3OHblyIAHrrk7BFaS_Z_xRwS_5z_bogviKBuUoi_bEN6sYpxi7iW8V1HfTfaesT8-y6yQ0x4EGC3-0UHaMuhx4”,

Hey @john456123333,

You need to pass both the tokens,
ie. - Gateway session token as well as User Auth Token.

Thanks

1 Like

hey team thanks for the quick replay,
but somehow i am still getting the same unauthorized error,
i have passed token like this way,(one token then second separated by comma)
Bearer eyJhbGciOiJSUzI1NiIsInR5cCIg…, Bearer CyF2JVsETCV1qPck…
is this the correct way? please guide me.

@ACONNECT can you please check

Did you tried to look into the roles you have

this kind of roles it shows,
is this good enough ???
“realm_access”: {
“roles”: [
“hiu”,
“offline_access”,
“healthId”,
“OIDC”,
“hip”
]
},
“resource_access”: {
“SBX_003189”: {
“roles”: [
“uma_protection”
]
},
“account”: {
“roles”: [
“manage-account”,
“manage-account-links”,
“view-profile”
]
}
},
@ACONNECT @IntegrationSupport

@john456123333, you have the desired roles to consume ABHA APIs. @Areeb, can you check this please.