beda-software / fhir-py

FHIR Client for python
MIT License
168 stars 31 forks source link

Is there a way to refresh a Token? #63

Closed kylejbrk closed 3 years ago

kylejbrk commented 3 years ago

When using a bearer token, is there a way to refresh it when it expires? Or will I have to create a new client instance each time?

ir4y commented 3 years ago

Hi @kylejbrk

Token lifecycle management is not a part of the library, so you have to implement it on your own. You may create a new client instance once the token is expired or just update the authorization attribute of the client instance. Both ways are ok.

kylejbrk commented 3 years ago

Curious, why isn't it within the scope of this library? Isn't that part of the FHIR authentication standard?

mkizesov commented 3 years ago

Sorry for the late response, @kylejbrk . As I know, it isn't a part of FHIR standart. Fast Healthcare Interoperability Resources (FHIR) is not a security protocol, nor does it define any security related functionality. https://www.hl7.org/fhir/security.html