OAuth2 handling class for FHIR servers. More...
Public Member Functions | |
__init__ (self, state=None) | |
reset (self) | |
can_sign_headers (self) | |
signed_headers (self, headers) | |
Returns updated HTTP request headers, if possible, raises if there is no access_token. | |
authorize_uri (self, server) | |
The URL to authorize against. | |
handle_callback (self, url, server) | |
Verify OAuth2 callback URL and exchange the code, if everything goes well, for an access token. | |
authorize (self, server) | |
Perform authorization on behalf of a system. | |
reauthorize (self, server) | |
Perform reauthorization. | |
from_state (self, state) | |
Update ivars from given state information. | |
extract_oauth_error (self, args) | |
Check if an argument dictionary contains OAuth error information. | |
Public Member Functions inherited from fhirclient.auth.FHIRAuth | |
register (cls) | |
Register this class to handle authorization types of the given type. | |
from_capability_security (cls, security, state=None) | |
Supply a capabilitystatement.rest.security statement and this method will figure out which type of security should be instantiated. | |
create (cls, auth_type, state=None) | |
Factory method to create the correct subclass for the given authorization type. | |
Public Attributes | |
aud | |
auth_state | |
app_secret | |
access_token | |
refresh_token | |
expires_at | |
jwt_token | |
app_id | |
Public Attributes inherited from fhirclient.auth.FHIRAuth | |
auth_type | |
app_id | |
Static Public Attributes | |
str | auth_type = 'oauth2' |
Static Public Attributes inherited from fhirclient.auth.FHIRAuth | |
str | auth_type = 'none' |
dict | auth_classes = {} |
Protected Member Functions | |
_authorize_params (self, server) | |
The URL parameters to use when requesting a token code. | |
_code_exchange_params (self, code) | |
These parameters are used by to exchange the given code for an access token. | |
_request_access_token (self, server, params) | |
Requests an access token from the instance's server via a form POST request, remembers the token (and patient id if there is one) or raises an Exception. | |
_token_params (self, server) | |
The URL parameters to use when requesting access token. | |
_reauthorize_params (self) | |
Parameters to be used in a reauthorize request. | |
Protected Attributes | |
_registration_uri | |
_authorize_uri | |
_redirect_uri | |
_token_uri | |
Properties | |
ready = property | |
state = property | |
Properties inherited from fhirclient.auth.FHIRAuth |
OAuth2 handling class for FHIR servers.
fhirclient.auth.FHIROAuth2Auth.__init__ | ( | self, | |
state = None |
|||
) |
Reimplemented from fhirclient.auth.FHIRAuth.
|
protected |
The URL parameters to use when requesting a token code.
|
protected |
These parameters are used by to exchange the given code for an access token.
|
protected |
Parameters to be used in a reauthorize request.
|
protected |
Requests an access token from the instance's server via a form POST request, remembers the token (and patient id if there is one) or raises an Exception.
|
protected |
The URL parameters to use when requesting access token.
fhirclient.auth.FHIROAuth2Auth.authorize | ( | self, | |
server | |||
) |
Perform authorization on behalf of a system.
server | The Server instance to use |
fhirclient.auth.FHIROAuth2Auth.authorize_uri | ( | self, | |
server | |||
) |
The URL to authorize against.
The server
param is supplied so that the server can be informed of state changes that need to be stored.
Reimplemented from fhirclient.auth.FHIRAuth.
fhirclient.auth.FHIROAuth2Auth.can_sign_headers | ( | self | ) |
Reimplemented from fhirclient.auth.FHIRAuth.
fhirclient.auth.FHIROAuth2Auth.extract_oauth_error | ( | self, | |
args | |||
) |
Check if an argument dictionary contains OAuth error information.
fhirclient.auth.FHIROAuth2Auth.from_state | ( | self, | |
state | |||
) |
Update ivars from given state information.
Reimplemented from fhirclient.auth.FHIRAuth.
fhirclient.auth.FHIROAuth2Auth.handle_callback | ( | self, | |
url, | |||
server | |||
) |
Verify OAuth2 callback URL and exchange the code, if everything goes well, for an access token.
url | str The callback/redirect URL to handle |
server | The Server instance to use |
Reimplemented from fhirclient.auth.FHIRAuth.
fhirclient.auth.FHIROAuth2Auth.reauthorize | ( | self, | |
server | |||
) |
Perform reauthorization.
server | The Server instance to use |
Reimplemented from fhirclient.auth.FHIRAuth.
fhirclient.auth.FHIROAuth2Auth.reset | ( | self | ) |
Reimplemented from fhirclient.auth.FHIRAuth.
fhirclient.auth.FHIROAuth2Auth.signed_headers | ( | self, | |
headers | |||
) |
Returns updated HTTP request headers, if possible, raises if there is no access_token.
|
protected |
|
protected |
|
protected |
|
protected |
fhirclient.auth.FHIROAuth2Auth.access_token |
fhirclient.auth.FHIROAuth2Auth.app_id |
fhirclient.auth.FHIROAuth2Auth.app_secret |
fhirclient.auth.FHIROAuth2Auth.aud |
fhirclient.auth.FHIROAuth2Auth.auth_state |
|
static |
fhirclient.auth.FHIROAuth2Auth.expires_at |
fhirclient.auth.FHIROAuth2Auth.jwt_token |
fhirclient.auth.FHIROAuth2Auth.refresh_token |
|
static |
|
static |