When assigning an OAuth2 grant using the following:
o365 aad oauth2grant add --clientId 253597f9-3c16-4744-8bc6-65f3e4ab62c4 --resourceId 0edd1406-a0a7-4f20-961c-06897ee9c665 --scope Calendars.Read
and then checking the objectId to add additional permissions the objectId contained a dash ('-') prefix.
$ o365 aad oauth2grant list --clientId 253597f9-3c16-4744-8bc6-65f3e4ab62c4
objectId : -Zc1JRY8REeLxmXz5KtixAYU3Q6noCBPlhwGiX7pxmU
resourceId: 0edd1406-a0a7-4f20-961c-06897ee9c665
scope : Calendars.Read
When attempting to call o365 aad oauth2grant set or o365 aad oauth2grant remove with this objectId, you simply receive the help message indicating the --grantId is missing.
This is easily fixed with escaping the objectId with a \\ prefix, e.g. \\-Zc1JRY8REeLxmXz5KtixAYU3Q6noCBPlhwGiX7pxmU.
Since this is an unlikley case, just wanted to document for others. A fix (IMO) is not necessarily needed.
When assigning an OAuth2 grant using the following:
and then checking the objectId to add additional permissions the objectId contained a dash ('-') prefix.
When attempting to call
o365 aad oauth2grant setoro365 aad oauth2grant removewith this objectId, you simply receive the help message indicating the--grantIdis missing.This is easily fixed with escaping the objectId with a
\\prefix, e.g.\\-Zc1JRY8REeLxmXz5KtixAYU3Q6noCBPlhwGiX7pxmU.Since this is an unlikley case, just wanted to document for others. A fix (IMO) is not necessarily needed.