can we implement OAuth2 in a web service(ASMX) c#?

Sathish Srinivasa Reddy 1 Reputation point
2022-04-27T10:31:29.32+00:00

How can we implement OAuth2 in a web service ASMX c#?

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,618 questions
{count} votes

1 answer

Sort by: Most helpful
  1. 2022-05-10T01:59:14.97+00:00

    Hi @Sathish Srinivasa Reddy . From a server side perspective the easiest and most (classic) ASP.NET compliant way to secure your asmx web services using OAuth2 is to create an Http Module (which will decide what asmx web services require authentication) or Handler (which can be wired/registered to all your asmx web services) to inspect the request Authorization header or a Custom SOAP header, retrieve the access token and finally validate it using JwtSecurityTokenHandler.ValidateTokenAsync.

    Please let us know if you need additional assistance.

    0 comments No comments