15,914,608 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by aleksvarga (Top 15 by date)
aleksvarga
5-Jan-18 10:14am
View
But how do I create the one that I linked? I already added the buGet package and the controls but how do I recreate the visualr epresentation I added?
aleksvarga
20-Dec-17 13:16pm
View
Yeah that's fine I really do appriciate the help that you have provided so far! It seems that it has something to do with Javascript and that I would have to do some manual parsing but I'll keep at it!
Thanks!
aleksvarga
20-Dec-17 9:30am
View
I wanted to learn web automation and I wanted to use a "real website" so I could apply my knowledge to other websites and there is alot of book websites that I would like to automate my daily login to that doesnt have an API so this would have to be the only way.
This way however I get to learn about well tokens etc.
Here you can see the entire source code, with a valid username and password that I just created for test purposes. I feel like there is some big mistake I am missing here.
https://ghostbin.com/paste/v3gvt
aleksvarga
20-Dec-17 8:53am
View
Hm.. Still giving me the 400 Bad request exception and now I am passing this as params
remember=true&username=myUsername&password=myPassword&csrf_token=AQAw7R_6HRfwLdhrcofiUA08cbNCFY8_SFzsiDZdPkjNN2Q12mkfFL6EcrcJQ5dLr5VNi17OLFSZUmDbLw
And I am passing it like this
https://ghostbin.com/paste/epbgj
I've made sure to check that the csrf_Token is the correct one.
Hm.. I wonder where it is tripping over..
aleksvarga
20-Dec-17 7:18am
View
Yep that sounds like it would work!
So the bottom line to the issue why I was getting a bad request is because it was posting that random stuff at the end
;Version=1;Domain=accounts.spotify.com;Path=/;Secure" with the request correct?
aleksvarga
20-Dec-17 7:16am
View
Oh! Because the Set-Cookie header string contains alot of unnessecary information!
"csrf_token=tokenHere;Version=1;Domain=accounts.spotify.com;Path=/;Secure"
So I would just want to extract or "Parse" this part - "csrf_token=tokenHere"
aleksvarga
20-Dec-17 7:09am
View
I keep getting this exception: The remote server returned an error: (400) Bad Request.'
Did I miss something? I feel like it could be that I am not setting some headers.
https://ghostbin.com/paste/27gd4
And I changed the string username = "username" just because I didnt feel like leaking my name and password :P
aleksvarga
20-Dec-17 7:03am
View
If I could vote for developer of the year, you would have my vote!
aleksvarga
20-Dec-17 6:56am
View
Last question.. How should the code flow?
Is it Create GET WebRequest > Get Token > Create POST WebRequest with the token we got from the GET? Because that POST Request generates a new token.
aleksvarga
20-Dec-17 6:18am
View
Ahhhh! Wow the brainflash I just had there! I thought using your webbrowser would do a POST request because you are you know sending data to the server but in reality its just asking for a GET!
To do a POST I need to do it through code!
Wow, honestly thank you so much for helping me with this, you are such a legend!
aleksvarga
20-Dec-17 6:12am
View
Ahh, so if there was more cookies I should parse it better!
Quick question, so when I actually try to make a login to spotify..
According to Fiddler "https://accounts.spotify.com/api/login" is where I post the params to. and the params being remember=true&username=username&password=password&csrf_token=theToken.. If I were to put it in pure url form would it be this?
Notice how I put the "?" mark after /login.. Thats the part I am unsure of.
https://accounts.spotify.com/api/login?emember=true&username=username&password=password&csrf_token=theToken
aleksvarga
20-Dec-17 5:57am
View
Oh yeah! That actually makes sense and thats very smart!
So something like this?
string cookies = response.Headers[HttpResponseHeader.SetCookie];
Because SetCookie sets the headers? And since it should only include 1 we dont need to itterate through it? Please correct my mistakes if there was any in there becase I am still trying to learn.
aleksvarga
20-Dec-17 5:47am
View
The cookie it gets is some sort of csrf_Token
https://i.imgur.com/xxj4vi3.png
aleksvarga
20-Dec-17 4:54am
View
Oh wow! Thank you so much!
What about cookies? It's not returning any cookies at all but on PostMan it does.
https://ghostbin.com/paste/rz7ss
aleksvarga
18-Dec-17 7:10am
View
It's just a random proxy from the internet.
Would you happen to know what protocol it uses? HTTP/HTTPS right?
Show More