MCPcopy Create free account
hub / github.com/authlib/authlib / _get_oauth_client

Method _get_oauth_client

authlib/integrations/base_client/sync_app.py:236–260  ·  view source on GitHub ↗
(self, **metadata)

Source from the content-addressed store, hash-verified

234 return session
235
236 def _get_oauth_client(self, **metadata):
237 client_kwargs = {}
238 client_kwargs.update(self.client_kwargs)
239 client_kwargs.update(metadata)
240
241 if self.authorize_url:
242 client_kwargs["authorization_endpoint"] = self.authorize_url
243 if self.access_token_url:
244 client_kwargs["token_endpoint"] = self.access_token_url
245
246 session = self.client_cls(
247 client_id=self.client_id,
248 client_secret=self.client_secret,
249 update_token=self._on_update_token,
250 **client_kwargs,
251 )
252 if self.client_auth_methods:
253 for f in self.client_auth_methods:
254 session.register_client_auth_method(f)
255
256 if self.compliance_fix:
257 self.compliance_fix(session)
258
259 session.headers["User-Agent"] = self._user_agent
260 return session
261
262 @staticmethod
263 def _format_state_params(state_data, params):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected