MCPcopy Create free account
hub / github.com/aws/aws-cli / get_auth_code_and_state

Method get_auth_code_and_state

awscli/customizations/sso/utils.py:255–270  ·  view source on GitHub ↗

Blocks until the expected redirect request with either the authorization code/state or and error is handled

(self)

Source from the content-addressed store, hash-verified

253 )
254
255 def get_auth_code_and_state(self):
256 """Blocks until the expected redirect request with either the
257 authorization code/state or and error is handled
258 """
259 LOG.debug(f'Waiting for auth code at {self.redirect_uri_with_port()}')
260 start = time.time()
261 while (
262 not self._is_done and time.time() < start + self._OVERALL_TIMEOUT
263 ):
264 self.http_server.handle_request()
265 self.http_server.server_close()
266
267 if not self._is_done:
268 raise PendingAuthorizationExpiredError
269
270 return self._auth_code, self._state
271
272 def set_auth_code_and_state(self, auth_code, state):
273 self._auth_code = auth_code

Callers 5

test_errorMethod · 0.80
_get_new_tokenMethod · 0.80
fetch_tokenMethod · 0.80

Calls 2

timeMethod · 0.45

Tested by 3

test_errorMethod · 0.64