0

I have an existing REST API Project that uses BASIC Authorization where username and Password are passed via Querystring. This API is being consumed by "n" number of clients. Now there is a request from one new client that they want 0Auth 2.0 authorization and cannot use Basic auth.

Since I am new to oauth and do not have much time to do R&D as its a quick requirement from client, i did a basic study and understand that for oAuth first client has call a method and we have to pass access token and then client can use this access token to authorize. My question here is can some one share a sample simple OAuth authorization code where client will pass username and password and then I can generate access token and share it with client. Appreciate any support here as its an emergency requirement.

Sammy
  • 57
  • 1
  • 5
  • It's not a good idea to pass sensitive data to query string. Be careful cause this kind of things breaks the GDPR requirements. See also: https://stackoverflow.com/a/2629241/18772705 – Kvble Apr 28 '22 at 07:57
  • Thats the reason client want to use oAuth 2.0. Any sample code availble which I can use to validate the credentials and pass access token? – Sammy Apr 28 '22 at 07:59
  • Is it dotnet core that you are using, or .NET Framework? – Octavian Mărculescu Apr 28 '22 at 08:02
  • .NET framework 4.5 – Sammy Apr 28 '22 at 08:04
  • Then maybe you should [check the docs](https://docs.microsoft.com/en-us/aspnet/identity/overview/getting-started/adding-aspnet-identity-to-an-empty-or-existing-web-forms-project) first, try to implement something and come back if you encounter any more issues – Octavian Mărculescu Apr 28 '22 at 08:07
  • I edited the link, I believe it's more useful to you to see how identity is added for existing applications instead. – Octavian Mărculescu Apr 28 '22 at 08:09
  • looks like you are trying to create something like this >https://www.thecodebuzz.com/create-generate-jwt-token-asp-net-core-example/ – Manish Apr 28 '22 at 09:26

0 Answers0