SMART on FHIR Python Client 4.2.0
 
Loading...
Searching...
No Matches
fhirclient.auth.FHIROAuth2Auth Class Reference

OAuth2 handling class for FHIR servers. More...

Inheritance diagram for fhirclient.auth.FHIROAuth2Auth:
fhirclient.auth.FHIRAuth

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

Detailed Description

OAuth2 handling class for FHIR servers.

Constructor & Destructor Documentation

◆ __init__()

fhirclient.auth.FHIROAuth2Auth.__init__ (   self,
  state = None 
)

Reimplemented from fhirclient.auth.FHIRAuth.

Member Function Documentation

◆ _authorize_params()

fhirclient.auth.FHIROAuth2Auth._authorize_params (   self,
  server 
)
protected

The URL parameters to use when requesting a token code.

◆ _code_exchange_params()

fhirclient.auth.FHIROAuth2Auth._code_exchange_params (   self,
  code 
)
protected

These parameters are used by to exchange the given code for an access token.

◆ _reauthorize_params()

fhirclient.auth.FHIROAuth2Auth._reauthorize_params (   self)
protected

Parameters to be used in a reauthorize request.

◆ _request_access_token()

fhirclient.auth.FHIROAuth2Auth._request_access_token (   self,
  server,
  params 
)
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.

Returns
s A dictionary with launch params

◆ _token_params()

fhirclient.auth.FHIROAuth2Auth._token_params (   self,
  server 
)
protected

The URL parameters to use when requesting access token.

◆ authorize()

fhirclient.auth.FHIROAuth2Auth.authorize (   self,
  server 
)

Perform authorization on behalf of a system.

Parameters
serverThe Server instance to use

◆ authorize_uri()

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.

◆ can_sign_headers()

fhirclient.auth.FHIROAuth2Auth.can_sign_headers (   self)

Reimplemented from fhirclient.auth.FHIRAuth.

◆ extract_oauth_error()

fhirclient.auth.FHIROAuth2Auth.extract_oauth_error (   self,
  args 
)

Check if an argument dictionary contains OAuth error information.

◆ from_state()

fhirclient.auth.FHIROAuth2Auth.from_state (   self,
  state 
)

Update ivars from given state information.

Reimplemented from fhirclient.auth.FHIRAuth.

◆ handle_callback()

fhirclient.auth.FHIROAuth2Auth.handle_callback (   self,
  url,
  server 
)

Verify OAuth2 callback URL and exchange the code, if everything goes well, for an access token.

Parameters
urlstr The callback/redirect URL to handle
serverThe Server instance to use
Returns
s The launch context dictionary

Reimplemented from fhirclient.auth.FHIRAuth.

◆ reauthorize()

fhirclient.auth.FHIROAuth2Auth.reauthorize (   self,
  server 
)

Perform reauthorization.

Parameters
serverThe Server instance to use
Returns
s The launch context dictionary, or None on failure

Reimplemented from fhirclient.auth.FHIRAuth.

◆ reset()

fhirclient.auth.FHIROAuth2Auth.reset (   self)

Reimplemented from fhirclient.auth.FHIRAuth.

◆ signed_headers()

fhirclient.auth.FHIROAuth2Auth.signed_headers (   self,
  headers 
)

Returns updated HTTP request headers, if possible, raises if there is no access_token.

Member Data Documentation

◆ _authorize_uri

fhirclient.auth.FHIROAuth2Auth._authorize_uri
protected

◆ _redirect_uri

fhirclient.auth.FHIROAuth2Auth._redirect_uri
protected

◆ _registration_uri

fhirclient.auth.FHIROAuth2Auth._registration_uri
protected

◆ _token_uri

fhirclient.auth.FHIROAuth2Auth._token_uri
protected

◆ access_token

fhirclient.auth.FHIROAuth2Auth.access_token

◆ app_id

fhirclient.auth.FHIROAuth2Auth.app_id

◆ app_secret

fhirclient.auth.FHIROAuth2Auth.app_secret

◆ aud

fhirclient.auth.FHIROAuth2Auth.aud

◆ auth_state

fhirclient.auth.FHIROAuth2Auth.auth_state

◆ auth_type

str fhirclient.auth.FHIROAuth2Auth.auth_type = 'oauth2'
static

◆ expires_at

fhirclient.auth.FHIROAuth2Auth.expires_at

◆ jwt_token

fhirclient.auth.FHIROAuth2Auth.jwt_token

◆ refresh_token

fhirclient.auth.FHIROAuth2Auth.refresh_token

Property Documentation

◆ ready

fhirclient.auth.FHIROAuth2Auth.ready = property
static

◆ state

fhirclient.auth.FHIROAuth2Auth.state = property
static

The documentation for this class was generated from the following file: