Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 116433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:10:38+00:00 2026-05-11T03:10:38+00:00

I have coded some JavaScript to perform an ajax call in an asp.net application.

  • 0

I have coded some JavaScript to perform an ajax call in an asp.net application. This triggers a method that calls a URL, sending some parameters in the POST.

The receiving page processes the data and updates our database.

We will be providing this code to customers to allow them to send us the data we need in their checkout process for each transaction.

Can anyone tell me if there is a way to prevent unauthorized access to this URL? Otherwise an unscrupulous developer could use this URL to add data to our database when they shouldn’t be.

Thanks for any pointers.


The issue here is that I will be providing the code to our customers and they will be adding it to their website. So I don’t have the option of them performing anything much more complex than adding a few lines of code to their site.

The code though, needs to perform a sending of data to our server, somehow securely?

Is this an impossible scenario or would I need to perform some sort of auditing after the processing has occurred?

Thank you everyone for some good suggestions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T03:10:38+00:00Added an answer on May 11, 2026 at 3:10 am

    You can use SOAP to pass a username/password with the request. SSL should be used to encrypt the data going over the wire. Here is some code that we use:

    This is a class that will hold the Credentials that are sent with the request:

    Imports System.Web.Services.Protocols Public Class ServiceCredentials  Inherits SoapHeader  Private _userName As String Public Property UserName() As String     Get         Return _userName     End Get     Set(ByVal value As String)         _userName = value     End Set End Property   Private _password As String Public Property Password() As String     Get         Return _password     End Get     Set(ByVal value As String)         _password = value     End Set End Property  Public Sub New()  End Sub  Public Sub NewUserInfo(ByVal ServiceUser As String, ByVal ServicePassword As String)     Me.UserName = ServiceUser     Me.Password = ServicePassword  End Sub 

    Add an attribute to the definition of your Web Service:

        <WebMethod()> _ <SoapHeader('CredentialsHeader')> _    Function MyWebMethod(ByVal paremetersPassed as String)    'check permissions here    If PermissionsValid(CredentialsHeader) then     'ok!        .......    else        'throw a permission error   end if  End Function 

    And then from there, just create a function (in my example, PermissionsValid) to check the permissions:

    Function PermissionsValid(byval Credentials as ServiceCredentials) as boolean      'check Credentials.Username and Credentials.Password here and return a boolean End Function 

    This may seem like a bunch of work, but this way, when they send a request, you can check it against a database or whatever else you want. You can also turn off a username easily at your end.

    A simpler way would be to restrict the IP addresses that are allowed to hit the service page. But, then you run into issues with IP addresses changing, etc.

    BTW, much of this was typed as I did the post, so you may need to check over the code to make sure it compiles. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 114k
  • Answers 114k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Ignoring the world of grief you could be causing yourself… May 11, 2026 at 10:17 pm
  • Editorial Team
    Editorial Team added an answer You can save this array using the NSKeyedArchiver, avoiding the… May 11, 2026 at 10:17 pm
  • Editorial Team
    Editorial Team added an answer I think you just need a double join, the following… May 11, 2026 at 10:17 pm

Related Questions

I have an application in which most requests are submitted via AJAX, though some
I'm building a Web Page that allows the user to pick a color and
I develop web applications and in my job so far, I have been waging
I am inside of... public class bgchange : IMapServerDropDownBoxAction { void IServerAction.ServerAction(ToolbarItemInfo info) {

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.