Search code examples
ip-addressabapremember-me

How to get the new IP address of the user after reboot?


I have to make a program which is logging in a user with username and password, and after reboot the program skips the login screen.

I am storing the user's PC IP address in a table and just select it. It's working pretty fine. The problem is that if the user reboots the PC a new IP address is stored in the database.

I am using TH_USER_INFO function module to get the IP with importing parameter addrstr.

Do you have any idea how to store a value or something that identifies a user even after reboot?


Solution

  • Personally think you are playing with fire. And recommend you do i properly.
    But if it is an intellectual discussion of how.... Then the answer is it depends on exactly you want to do.

    If the Problem is truly an unauthenticated one. Ie you dont care who is on the other end, then its easy to do. WEB Logon via browser with no password. Yes People actually do this shit. And if you wanted an Unauthenticated service, then why not.... Here is how: TCode SICF. -> Then External Aliases. External Aliases Create a new Alias

    Then go to the login Tab and enter a hard coded userid and Password. Then every time someone calls this endpoint, they are logged on automatically as this user. BECAREFUL what real service you redirect the call to in the Target Element tab. This is leaving the door open for that service !!! And if you were foolish enough to do this. Make sure the user only has access to the one service !

    If you cant to do SSO properly and want a poor mans solution that is half way safe, then the alternative approach is to have the user login via a tool with his password stored securely. This way you have at least Basic Auth every time the login to sap. You resolve the problem of repeated logon with SSO into a tool on the front end.

    This works with both Browser and SAP GUI.

    Tools like Keepass are Free open source.

    The tool encrypts the data stored inside.

    Keepass Entry screen

    The command to open SAPGUI for a give System client User and password is cmd://sapshcut –maxgui -system=E01 -client=001 -language=EN -user={USERNAME} -pw={PASSWORD}

    Then everytime you want to logon its right click on the entry and select open.... OPEN

    I use this tool for logging into every SAP system we have that uses basic auth. I use it for Websites and it even for support 2fa Passcodes. Thats right no 2fa app on phone, use 2fa inside keepass as an alternative. It is a very powerful tool.

    Option 2 is an old favorite . It involves a REGEDIT hack. Forcing SAPGUI to allow and old feature that was disabled. Yes SAP gui did for 20 years allow passwords to be saved. Here is one of n blogs on this topic. SAPGUI Logon pad save password HACK

    Of course if all is too hard, you could be a complete cowboy And make a desktop shortcut with a password stored in plain text.

    "C:\Program Files\SAP\FrontEnd\SAPGUI\sapshcut.exe" –maxgui -system=SID -client=001 -language=EN -user=UNAME -pw=<rUserious?>

    with a target "C:\Program Files\SAP\FrontEnd\SAPgui"