Skip to content

Commit ae4bc8b

Browse files
committed
Revert device code
1 parent 51e9af4 commit ae4bc8b

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/azure-cli-core/azure/cli/core/auth/identity.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,21 +172,18 @@ def _prompt_launching_ui(ui=None, **_):
172172
)
173173
return check_result(result)
174174

175-
def login_with_device_code(self, scopes, claims_challenge=None):
176-
flow = self._msal_app.initiate_device_flow(scopes, claims_challenge=claims_challenge)
175+
def login_with_device_code(self, scopes, **kwargs):
176+
flow = self._msal_app.initiate_device_flow(scopes, **kwargs)
177177
if "user_code" not in flow:
178178
raise ValueError(
179179
"Fail to create device flow. Err: %s" % json.dumps(flow, indent=4))
180180
from azure.cli.core.style import print_styled_text, Style
181181
print_styled_text((Style.WARNING, flow["message"]), file=sys.stderr)
182-
result = self._msal_app.acquire_token_by_device_flow(
183-
flow,
184-
claims_challenge=claims_challenge
185-
) # By default, it will block
182+
result = self._msal_app.acquire_token_by_device_flow(flow, **kwargs) # By default it will block
186183
return check_result(result)
187184

188-
def login_with_username_password(self, username, password, scopes):
189-
result = self._msal_app.acquire_token_by_username_password(username, password, scopes)
185+
def login_with_username_password(self, username, password, scopes, **kwargs):
186+
result = self._msal_app.acquire_token_by_username_password(username, password, scopes, **kwargs)
190187
return check_result(result)
191188

192189
def login_with_service_principal(self, client_id, credential, scopes):

src/azure-cli-core/azure/cli/core/util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ def b64decode(s):
622622
encoded = base64.b64decode(s.encode("latin-1"))
623623
return encoded.decode('latin-1')
624624

625+
625626
def b64_to_hex(s):
626627
"""
627628
Decodes a string to base64 on 2.x and 3.x

src/azure-cli/azure/cli/command_modules/profile/custom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def login(cmd, username=None, password=None, tenant=None, scopes=None, allow_no_
151151

152152
if claims_challenge:
153153
from azure.cli.core.util import b64decode
154-
claims_challenge=b64decode(claims_challenge)
154+
claims_challenge = b64decode(claims_challenge)
155155

156156
interactive = False
157157

0 commit comments

Comments
 (0)