Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Error in token acquisition when password contains special characters #1492

Closed
1 of 7 tasks
brenkehoe opened this issue Feb 4, 2019 · 8 comments
Closed
1 of 7 tasks

Comments

@brenkehoe
Copy link

brenkehoe commented Feb 4, 2019

Which Version of ADAL are you using ?
4.5.0

Which platform has the issue?
net45

What authentication flow has the issue?

  • Desktop / Mobile
    • Interactive
    • Integrated Windows Auth
    • Username Password
    • Device code flow (browserless)
  • Web App
    • Authorization code
    • OBO
  • Web API
    • OBO

Other? - please describe;
Calling AcquireTokenAsync with resource, clientid and credential
Is this a new or existing app?
a. The app is in production, and I have upgraded to a new version of ADAL

Repro
Call AcquireTokenAsync with a credential where the password contains special characters such as < or &

Expected behavior
Passwords with special characters should be handled. This works correctly in version 3.19.8

Actual behavior
The following error occurs AADSTS90013: Invalid input received from the user.

@bgavrilMS bgavrilMS self-assigned this Feb 4, 2019
@jmprieur jmprieur added this to the 4.5.1. milestone Feb 4, 2019
@bgavrilMS
Copy link
Member

Can repro, I tried a password similar to

Na<&>ko&&<bzz>

@bgavrilMS bgavrilMS added bug and removed Investigate labels Feb 4, 2019
@bgavrilMS
Copy link
Member

MSAL is not affected. It seems that the underlying issue is that we set the Content-Type to

Content-Type: application/x-www-form-urlencoded; charset=utf-8

It's the charset that is problematic. Removing it makes the http request pass.

I will follow up with the server guys to better understand if this a bug on their side. I cannot just remove the charset as it was added a long time ago to support some other scenario.

@bgavrilMS
Copy link
Member

Server guys confirmed this a bug on their side. Will track this getting fixed and update the thread.

@jmprieur
Copy link
Contributor

meanwhile, @brenkehoe, if you want to move to MSAL.NET, this will solve this issue: https://aka.ms/adal-net-to-msal-net

@jmprieur jmprieur removed the bug label Feb 18, 2019
@jmprieur jmprieur modified the milestones: 4.5.1., 4.5.2 Feb 18, 2019
@jmprieur
Copy link
Contributor

jmprieur commented Feb 27, 2019

Internal bug on the Microsoft identity platform service: 647691

@jmprieur jmprieur removed this from the 4.5.2 milestone Mar 8, 2019
@bgavrilMS
Copy link
Member

I believe this has been fixed.

@filippo-orru
Copy link

If this has been fixed, the link and known issues section can be removed from https://github.com/AzureAD/microsoft-authentication-library-for-python/wiki/Username-Password-Authentication

@bgavrilMS
Copy link
Member

Done, thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants