Overview
Authenticating users using the Resource Owner Password Flow with Multifactor Authentication (MFA) to obtain an MFA token encounters issues when the password contains an & symbol.
- If the user password has the & character at the beginning of the password, it gives the error
- missing required parameter password
- If the & character is in the middle of the password, it gives us the error
- incorrect username and password
Applies To
- MFA Token
- Resource Owner Password Grant (ROPG)
- Password
Cause
This is expected because the call does not use the correct URL encoding. If the password uses the & symbol, it must be encoded.
Solution
Research the correct way to encode the URL parameter for the language or tool used to make the request to the token endpoint.
For example, the cURL command uses the --data-urlencode method as in the provided example:
curl --request POST \
--url 'https://YOUR_DOMAIN/oauth/token' \
--header 'content-type: application/x-www-form-urlencoded' \
--data grant_type=password \
--data 'username=test@email.com' \
--data-urlencode 'password=&Test1234!' \
--data 'audience=API_IDENTIFIER' \
--data scope=openid profile \
--data 'client_id=CLIENT_ID' \
--data 'client_secret=CLIENT_SECRET'