PROD: https://api.helthjem.no/auth/oauth2/v1/token
PRE-PROD: https://api.pre.helthjem.no/auth/oauth2/v1/token
The Login API provides a secure way to obtain an OAuth and JWT token for authorization. The token serves as a means of authentication and is valid for a specific duration. On the client side, the token is handled as a plain string. If the token expires, it can be refreshed by calling the endpoint again.
Token Expiry:
By default, the token remains valid for 24 hours. However, there is an option to reduce this validity period if needed.
Request example
json{ "client_id": "xxx", "client_secret": "xxx", "grant_type":"client_credentials" }
Response example
Upon successful authentication, the API will respond with a JSON object containing the following information:
json{ "token": "xxx" "expires_in": 86400, "token_type": "Bearer" }
The
token
field holds the JWT token, which should be used in subsequent API requests. The expires_in
field denotes the number of seconds the token will remain valid.
Note: Ensure you keep your
client_id
and client_secret
confidential and never expose them publicly.