1. Dan Harrel
  2. SnapDevelop
  3. Thursday, 4 February 2021 21:51 PM UTC

Are there any samples or guidance for securing a ASP.NET Core 3.1 Web API as templated by SnapDevelop?  

For example, I am working from the following fine sample:

ASP.NET Core 3.1 - Simple API for Authentication, Registration and User Management | Jason Watmore's Blog

I have written C# code to log on to this fellow's sample web service and call secured APIs passing the JWT token.  I now want to adapt his code to similarly secure my Web API.  This code is quite complicated, particularly for a newer developer in these technologies.  In particular, the "Startup.cs" file does not jive exactly with the template created by SnapDevelop.  

Suggestions, guidance, and samples are welcome and appreciated!

 

Accepted Answer
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Thursday, 4 February 2021 22:06 PM UTC
  2. SnapDevelop
  3. # Permalink

Hi Dan, SnapDevelop is pure standard C# so you could secure your REST APIs anyway you find through Google.  We have a very simple tutorial to add a basic JWT token, which I would recommend you use as a starting point before going on to learn more complex security implementations.  But really, you have a blank canvas and can do anything you want.  If your REST API is being called by PowerBuilder, then both OAuth and JWT are supported.

Best regards,
Armeen

Comment
  1. Dan Harrel
  2. Tuesday, 9 February 2021 14:39 PM UTC
You are very welcome, and thank you!
  1. Helpful
  1. Glenn Scamman
  2. Friday, 17 December 2021 22:25 PM UTC
Dan, thank you for pointing out the missing using directive in the SampleController.cs in the tutorial. I was pulling my hair out trying to figure out how I was supposed to be accessing the User attributes from that class!



Appeon, please, please update the tutorial to reflect this!
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Saturday, 18 December 2021 01:45 AM UTC
Hi Glenn, Please send any product enhancement requests by email to product@appeon.com. It's very easy for our team to miss suggestions that are posted to the Q&A like this.
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.