Cli-microsoft365: Bug report: o365 login command failed if the password contains a special character (>, ;)

Created on 14 May 2020  路  5Comments  路  Source: pnp/cli-microsoft365

o365 login syntax error issue

Description

o365 login command failed if the password contains a special character (>, ;)

Steps to reproduce

login --authType password --userName [email protected] --password U#*h$CpY>GiU7q9:.KJ6sncYVL|;

Expected result

Login command should work correctly

Actual result

invalid syntax with ;

Environment

Git Bash on Windows 10

question waiting on response

All 5 comments

@ashokswain27 have you tried to enclose the password in double quotes? For example:

--password "U#*h$CpY>GiU7q9:.KJ6sncYVL|;"

o365 login --authType password --userName "[email protected]" --password "U#h$CpY>GiU7q9:.KJ6sncYVL|;"
o365 login --authType password --userName [email protected] --password "U#
h$CpY>GiU7q9:.KJ6sncYVL|;"

Yes, tried with double quotes. It shows the below error:
Invalid Command. Showing Help.

If you add the --debug option to the command line, can you see what's exactly going over the wire and if the password is altered in any way?

Closing due to lack of response

@ashokswain27 , @VelinGeorgiev , @waldekmastykarz
Sorry to comment on an old issue, but I noticed it was closed only due to lack of response.
This works if you enclose your password with single quotes, not double quotes

Was this page helpful?
0 / 5 - 0 ratings