How to authenticate rest API using Service account and system generated token code

How to authenticate rest API using Service account and system generated token code

  

Hello,

I would like to understand how to use service accounts to authenticate rest API's. I have created a service account in lifetime and generated token for this user. I would like to know, how to pass this token and username to authenticate the API.

Sudhakar Korrapati wrote:

Hello,

I would like to understand how to use service accounts to authenticate rest API's. I have created a service account in lifetime and generated token for this user. I would like to know, how to pass this token and username to authenticate the API.

Sudhakar,

Maybe you can do is construct some logic in your rest api to receive this token through or from your client .. like a Header authentication. Inside the header you can send your token to validate the client.


If you need some more explanation don't hesitate to contact,


Regards 


Use Authentication header:

Authorization: Bearer <authentication_token>

For more information:

https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/LifeTime_Deployment_API/REST_API_Authentication

Harlin Setiadarma wrote:

Use Authentication header:

Authorization: Bearer <authentication_token>

For more information:

https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/LifeTime_Deployment_API/REST_API_Authentication

Hi Harlin,

the method you suggested above is working when we try to access the API's provided by lifetime like 

GET /applications/

GET /applications/{ApplicationKey}/

GET /applications/{ApplicationKey}/versions/  .........etc.

Sudhakar is trying to get an answer for whether we can use the service account and its generated token created in lifetime to authenticate other rest API's created in other applications. I am also having the same query. Is there any way with which i can authenticate my rest API's of an application with the key and service account generated at lifetime ?


This was the only document I found.

And it only said Service Accounts are needed for Lifetime API, but does not state that it can be used for our own API.

https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/LifeTime_Deployment_API/REST_API_Authentication