Quick Start
Get your Access Token
Your API requests are authenticated using Access Token. Access Token can be requested using username and pssword. Any request that doesn't include an Access Token will return an error.
You can request username and password
from BM Admin at any time.
Take a look at how you might call this method using our official libraries, or via curl
:
curl
--location 'http://IP:PORT/auth/realms/bill-master/protocol/openid-connect/token'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'password=12345'
--data-urlencode 'username=my_username'
--data-urlencode 'client_id=microservice'
--data-urlencode 'client_secret=ssssecretttt'
--data-urlencode 'grant_type=password'
--data-urlencode 'scope=openid'
You will recieve JWT token in the body as Json, parse it and extract access_token
as Access Token:
{
"access_token": "eyJhbGciOiJS.......TCG-dKml8QNybc3cGyRGnw23g",
"expires_in": 900,
"refresh_expires_in": 1800,
"refresh_token": "eyJhbGciOiJIUzI1....Z1KKlsRikR4QfzQ9x829lpuBDzkv30AjTp1wSyeLV2o",
"token_type": "Bearer",
"id_token": "eyJhbGciOiJSUzI..........VwBfnhF7U92ZT6Zw72hHZFWFgfG6jz_UAGhD7A",
"not-before-policy": 0,
"session_state": "9f2a9b0d-1c9f-41f4-958a-2efc7ba96966",
"scope": "openid email profile"
}
Last updated