AspNet.Security.OAuth.Providers: Mixcloud Does Not Appear to Support the `state` Parameter
Describe the bug
In the Mixcloud provider implementation, efforts are being made to “bundle” the state
parameter and then “unbundle” it upon authentication. The reason for this is that it appears that Mixcloud does not currently support the state
parameter and does not pass it back when the code exchange occurs.
Steps To reproduce
Use the provider without the state
bundling as exists. The provider complains that the state cannot be read. This is because it is not provided/returned back from Mixcloud.
Expected behaviour
state
is returned by Mixcloud.
Actual behaviour
state
is not returned, so bundling must take place. Honestly, I can’t believe I got that to work. 😅 Ideally, we can get this resolved on Mixcloud’s side and remove the bundling/unbundling as currently implemented. If this occurs, I can create a PR to get things working as expected.
System information: N/A
Additional context I have opened a ticket with Mixcloud support and they have assigned the issue to an internal developer. Creating this ticket to properly capture the issue and also allow for Mixcloud to collaborate/input here if needed.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 29 (24 by maintainers)
Hey @Mike-E-angelo , Mixcloud’s customer support has forwarded me your emails and I’ll be looking into this as soon as I can
I’ll let you know here once I have more info/if we’ve done the changes you asked 😃
PS: I work for Mixcloud
Edit: This isn’t forgotten, I had some time-off/got pulled elsewhere : )
Naturally, after my Grumpy McGrumpyface rant, I received a reply from MixCloud that this should be fixed now that we should try again.
😁😅😭
I will add this to my things to do. I suddenly got swamped with a ton of tasks so it should be later this week, if not the weekend. I will update here either way as soon as I can. 👍
Whew finally putting this thing out of its misery. I will never have anything to do with Mixcloud again and regret ever opening this issue 😭
Thank you very much for checking in here @ben-xo and for your time investigating this issue. At the risk of piling on here, however, I do share the concern and frustration with others here about how long it has taken to address this issue as well as the continued misunderstanding on what exactly the issue here is.
To summarize, there is nothing special about C# or this repository with regards to this issue, except that it expects a fully-compliant Oauth2 as developed by your team. As such, this issue as identified is an incomplete implementation of the Oauth2 specification on Mixcloud’s side, and the GitHub issue here is meant to track it in a C# client implementation which in turn expects a fully operational/compliant Oauth2 implementation.
At the risk of a bad pun, I hope this further clarifies the “state” of this issue here. 😁
Woo, to be honest, this is getting quite ridiculous, don’t you guys have test clients you use internally to test your own server implementation? (well, I guess not, otherwise we wouldn’t have this thread opened for more than a year 🤣)
Anyway, it’s easy to test using a program like Postman (authorization tab -> OAuth 2.0: fill in the form and click on “Get New Access Token”) or manually by constructing the request URL yourself and using your preferred browser:
If you’re redirected to
the_redirect_uri_of_a_registered_client?code=abc&state=xyz
(if the authorization is approved) orthe_redirect_uri_of_a_registered_client?error=access_denied&state=xyz
(it you refused the authorization demand), it works. Otherwise, it doesn’t.Alright, I have heard back from MixCloud customer support. This issue has been identified as a bug on their end and is slated to be worked on fixing it Soon™.
https://youtu.be/Bro-WwwroEA
No timetable/estimate, however.
Hi @limaAniceto - any update on this from Mixcloud?
Closing for now. If Mixcloud fixes/improves their implementation in the future, we’ll revisit that.
I added a Mixcloud integration to the new OpenIddict client (https://github.com/openiddict/openiddict-core/pull/1594) and I can confirm the
state
issue hasn’t been fixed and that a workaround is still needed.(oh, and they return JSON responses as
text/javascript
responses 🤣)I’m personally speechless.
Proper
state
support is absolutely essential to the security of an OAuth 2.0 client as it prevents session fixation/forged requests attacks (and, when implemented correctly, helps reduce the ability to steal authorization codes via referrer leakages). For the aspnet-contrib provider, we used a workaround to have astate
-like mechanism but I really doubt most Mixcloud clients in the wild went that far. The number of applications vulnerable to the classes of attacks I mentioned should be astonishing…You can use the client in our
samples
directory.Haha, it’s indeed getting really ridiculous, given how easy this should be to fix. For reference, in OpenIddict, it’s implemented in literally 3 lines of code 🤣
Hey @limaAniceto. Do you have (good) news for us? 😃
Cool - thanks for the update. I’ll leave this issue open until we hear back from them.