Step by Step Tutorial - Authenticating to a REST API in c#
Вставка
- Опубліковано 5 вер 2024
- This video follows on from the C# REST Client tutorial to include 2 authentication types: Basic and NTLM (Windows), using a custom headers as well as the NetworkCredential class
Read the step-by-step tutorial here: dotnetplaybook...
- My Book: www.apress.com...
GEAR
----
I created this video using all the following gear, (which I paid for myself!):
- My Camera: amzn.to/2W4ULRc
- Wide Angle Lens: amzn.to/2FfEDGK
- USB3 Docking Station: amzn.to/2T7T2IY
- Memory Cards:amzn.to/2TKVLxf
- Lavalier Mic: amzn.to/2FcfdbM
- Video Editing: amzn.to/2FhKL1j
- Productivity: amzn.to/2Ckywza
Note: I may receive a small commission if you choose to buy something from Amazon after clicking any of the links above.
Wow! What a pleasure to watch a tutorial in my native language! Will definitely take a look at your other videos. Thanks from Scotland!
Your videos are excellent. I have watched 2 of them now and about to watch #3 (Deserializing JSON...). Your presentation style suits this type of learning perfectly. Thanks so much for your videos.
Hey Dan, My pleasure! Love hearing that people find them useful! Cheers, Les
It wasn't easy to get IIS Windows Authentication under windows 10 home, but luckily, I managed it. You have touched subjects that I've never seen before, like attaching apps to the IIS or ISS available workaround. Thanks for enlarging my knowledge in those areas.
Awesome! Thanks Les. I learned alot. Super explanatory descriptions of the steps as you type the code. I like typing along too and the pace was excellent. Well done!
Knowledge not used is dead!... And we that are alive have opportunity! Love you brother!
Was watching your videos. All seem to be good. Your newer videos are way better. Good work Les
you are the best. your way of teaching is really nice. May Allah give you more knowledge and best of health
Hi Adnan - lovely words - made my day! Cheers, Les
What a fantastic tutorial, I have been battling with trying to authenticate to Jira and this has solved my problem. Thank you
this was a great tutorial. I was more interested in the JIRA stuff as I was completely lost as to how to connect to JIRA's API.
A suggestion for future videos: Would be great to start getting into the POST method. Especially one where you POST information to a JIRA Ticket.
Another suggestion: If you are going to talk about JIRA, please mention it in the details or titles. I have been looking for a C# and JIRA tutorial like yours for about 3 days and just happened to find this one. Just a tip for thought for anyone searching stuff like "JIRA API C# "
Regardless, it was a very informative video. Thanks
Hi Arnav, thanks for the feedback. I'mjust finishing up a video on working with JSON, then off on holiday for a month. When I get back I'm going to do a detailed video on working with Jira which will cover both POSTing and working with the Jira JSON payloads. Good tip on making sure the title has the relevant detail - noted!
binarythistle that sounds great. Just wondering, could you point me in the right direction as to how to update an issue status with the Jira API? I'm working on this project and kind of spending too much time wrapping my head around it all. I'm new to C#
You’re videos are great. I wish you would make more.
Excellent video Les. Learnt loads. I have no suggestions for improvement like you asked.
Nice On Les! Really appreciate it Buddy!
Great to hear thanks mate!
GREAT! Thank you spending so much time for us!
Hey Hugo - thanks for the feedback, it's my pleasure! I enjoy making the videos anyway, and if people find them useful that's even better! Cheers
Please do a tutorial on how to obtain a session ID and store it for use
Thanks for sharing your knowledge.
thank you for share, I am learning a lot, could you please add some sample with a POST, PUT and DELETE options.
Cool glad you're getting stuff out of my tutorials! I'm on holiday at the moment, (gone back to Scotland!), but will be back in Australia in a few weeks, was planning an extended tutorial on POST, PUT etc. So stay tuned! Again thanks for the feedback.
Dude, your video is amazing. Thank you.
Thanks Peterson!
Clean and easy to follow, thanks and keep it up!
Hi, this has been really helpful so far. Would you have any recommendations on how to connect to a server that uses a certificate instead of basic authorization?
Thanks
Very nice step by step tutorial. Is it possible to leverage an OAuth 2.0 token based authenticating to call external Web API service provider in a console app without clicking the GET/POST button? The console app would allow us to schedule the program execution at a certain time without human intervention. So far, I have not found one yet. Thanks again!
I wonder was this tutorial using async/await in it? Thank you.
Les how is the compensation part for core C# in Scotland? After 10 years in C# I shifted to D365 and Azure for better pay - this is in Canada and USA. I am currently in Tennessee but did spend quite some time in Toronto.
Thank a lot for your videos! I am new to C# coding. I wonder if it is possible to download your sample source code used in this video. It is really appreciated!
Thanks for the video. How would client certification (especially from the smartCard) authentication will work with IIS?
looking for an oauth2 authentication. is that something you have done? thx
Thank you for video, it help very much.
Cool glad it helped!
Hi-5 Les! Just curious whether we can parse the username and password at Rest to do further authentication i.e. against the db I am thinking parse out the username and pwd to do further auth. inside Get() action method. Thx Les. Great work!
[Authorize(Users = "")]
public class LoginController : ApiController
{
// GET api/values
public IEnumerable Get()
{
return new string[] { "value1", "value2" };
}
}
Great tutorial. If you can teach Jira a little bit more will be better. I don't have Jira, so I can't follow all the steps in the video.
Excellent tutorial. Very patient and detailed, as a tutorial should be.
Is it possible to leverage what's here (more or less) to do the following: authenticate a request for a token from a third-party REST service token endpoint; and then, using that token, pass a business object to the third-party's web app url so that the fields of said business object automatically populate the textboxes of the third-party form? I need to implement something along those lines in a Silverlight app. I hear WebClient or WebRequest may be better in such a case (as opposed to HttpWebRequest) but I have no idea really. Thanks!
Thanks for the feedback. I may do some more authentication stuff in the near future - s0 stay tuned!
Can I see the debugOutput method.
Is this works in Xamarin.forms?
Muchas Gracias desde Colombia
Thanks Gustavo - greetings from Australia!
how can i to use encryption AES?
Cool
Sir, wellcome to Vietnam
Greetings. Thanks for your video. It was very useful. Can you also add some sample for using Token Authentication? Thanks :)
Can you do it on win10 home, since it doesn't have windows authentication tool?
Hey, I've a quest. Where debugOutput is? Can't find it, and my code is missing it
Hi Pedro, been a while since I did this video, so can't remembe if I showed the code. You can find an example of it here though on GitHub: github.com/binarythistle/VP-0-REST-Client/blob/master/restClient_0/Form1.cs you may need to change some of the values for the text boxes etc.
So I’m following along but when I run my program I get WAY more then just the json back. Is there something I missed or need to add?
Hey there what API are you using? Can you provide a small sample of the output?
Hi sir,
thanks for sharing... sir I have a VB.NET Windows Application and I want to connect with Firebase database is it possible if yes please tell me how I can.
Thanks In advance
Do you have the code of this project in some download link? Excelent Work!
I'am requesting. please make a video how to use REST API firebiase using vb.net . please . thanks alot
When I try localhost: I get error - Authorization has been denied for this request.
xieee hua pua piao
Can this code work on OAuth 1.0 authentication type?
thank you but can you please upload source code
would you please create a tut REST API in vb.net? pls pls
The code returns 401, what is wrong?
That's a http 401 - unauthorised response. Could be many things wrong... To eliminate any errors in the code - try using something like "Postman" : (www.getpostman.com/downloads/) to test your API with the same credentials. If you still get 401 then it's not the code and something else, (e.g. wrong username and password). If that works then may be something in the code... I'd need to see what you'd written and have access to the API to help further though. Cheers, Les
Code?
Scotland
Hello, Love your videos. Is it possible to contact you via email and phone? I have some specific questions. Thank you!
Thanks Robin. Pop over to dotnetplaybook.com and my email is on there. Typically though I don't really have the time for detailed answers to questions just to give you a heads up - although I do try.