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#?

Developer technologies | C#
{count} votes

1 answer

Sort by: Most helpful
  1. Alfredo Revilla - Upwork Top Talent | IAM SWE SWA 27,526 Reputation points Moderator
    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.