How to avoid to give direct credential in .NET source code

Gani_tpt 1,706 Reputation points
2022-01-04T09:13:07.123+00:00

I am developing .NET Application. I have cloud SAP application which contains documents.

Using Cloud SAP, i am fetching the data as an xml and storing the data in to MySQL database.

for this, i am developing one page code.

The question is, i am maintaining SAP credentials and SQL server credentials in same page.

It means, directly i am mentioning the username and password.

Due to safety and security, i want to avoid to use direct credential in my code.

I want to use secured credentials either encrypt or some other secured logic should apply here...

How to do this...?

162106-image.png

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,363 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ken Tucker 5,846 Reputation points
    2022-01-04T11:02:49.467+00:00

    For SQL Server I would try to switch to using a trusted connection. (IE give the user the app pool is running under just the access needed for the database)

    I would look at using Oauth tokens for talking with the SAP cloud

    https://www.itsfullofstars.de/2020/05/how-to-obtain-an-oauth-2-0-token-in-sap-cloud-platform/


0 additional answers

Sort by: Most helpful