SSO with SPNEGO Authentication in NetWeaver.
Share

[[{“value”:”

SSO with SPNEGO Authentication in NetWeaver.

In this Blog i will cover SSO with SPNEGO Authentication in NetWeaver.

What is SPNEGO?
SPNEGO (Simple and Protected GSSAPI Negotiation Mechanism) is an authentication protocol used in Single Sign-On (SSO) environments. It allows a client and server to negotiate which security mechanism to use, most commonly Kerberos and sometimes NTLM.

Overview of SPNEGO.
Seamless Single Sign-On (SSO).
No repeated username/password prompts.
Secure ticket-based authentication.
Integration with Microsoft Active Directory.

Team Requirements for Configuration SPNEGO SSO.
Microsoft AD Team.
Linux Team.
Basis Team.

What is keytab file?
A keytab file stores Kerberos security information that allows a server to authenticate with Active Directory without typing a password.

What is ktpass?
ktpass is an AD-side command used to create a Kerberos keytab file for a service account/SPN, so applications like SAP can authenticate with Active Directory using Kerberos SSO.

Linux Team Steps
Verify hostname
Verify DNS
Verify NTP Synchronization
Verify connectivity to domain controllers
DNS resolution working correctly

Basis Team Steps
SAP NetWeaver AS Java 7.x—————————I have 7.5 with SP 36 Latest.
NWA access and UME access—————————Yes it is accessing.
HTTPS configured (strongly recommended)————-I already configured HTTPS.

Let’s Start SPENGO Configuration.
Active Directory Configuration Steps. (AD Team Steps)

Step 1 Service User Create in AD.

AD Team need to Create a new service account in DC.
Open Active Directory Users and Computers (run dsa.msc or access it from Server Manager). Navigate to your domain → Users container. Right-click → New → User.

shalabhkumar_0-1793946556867.png

Step 2  Set password.

On the next screen, enter a strong password and select “Password never expires”.
Note: Service account passwords should never expire, as an expired password can stop Kerberos authentication working.
Click next to Finish.

shalabhkumar_1-1793946627535.png

Step 3 Enable AES encryption flags

Open the account Properties → Account tab in the Account options list, enable both AES flags:
This account supports Kerberos AES 128-bit encryption.
This account supports Kerberos AES 256-bit encryption.
Account expires Never.
Note: Enable AES encryption settings for the service account.

shalabhkumar_2-1793946756493.png

Below screenshot Properties of Service user account which is AD Team created.
Click on Delegation Tab to check Do not trust this user for delegation option selected.Click on Member of to check Domain Users members of Service Account.

shalabhkumar_3-1793946921960.png

Step 4 Register the Service Principal Name (SPN) (AD Team Steps)

Before setting the SPN, run nslookup to find the server’s exact hostname and any alias names (CNAMEs). This helps ensure the SPN is configured correctly.

shalabhkumar_4-1793947044391.png

Now execute below command on Domain Controller to set SPN with only hostname.
setspn -A HTTP/<host> <service-user>

shalabhkumar_5-1793947085090.png

Now execute below command to set SPN with FQDN name.
setspn -a HTTP/<FQDN> <service-user>

shalabhkumar_6-1793947127122.png

Checking the SPN status with below command.
setspn -l <service-user>

shalabhkumar_7-1793947181739.png

SPN has been set properly.

Step 5 Generate the Kerberos keytab file.

Below is command syntax.
ktpass -princ HTTP/<fqdn>@DOMAIN.COM -mapuser <ServiceAccount> -crypto AES256-SHA1 -ptype KRB5_NT_PRINCIPAL -pass * -out sap.keytab
Below command need to run in AD Server to generate keytab file. (AD Team Steps)
C:> ktpass -princ HTTP/prd02807.kr-internal.nat@GEO-INTERNEL.NAT -mapuser SVC-GLEBE-PRD-AD -pass “F-2AJJYA$Wb4BCrN3N#S4” -ptype KRB5_NT_PRINCIPAL -crypto AES256-SHA1 -out prdhost.keytab
Keytab file will create with prdhost.keytab name.Meaning of important parameters
princ → Kerberos principal/SPN, for example HTTP/server.domain.com@DOMAIN.COM
mapuser → AD service account associated with the principal
pass * → prompts for the service-account password
ptype KRB5_NT_PRINCIPAL → specifies the principal type
crypto AES256-SHA1 → generates an AES256 Kerberos key
out → name/path of the generated. keytab file

Step 6 Open User Management Page and Click on Configuration.    (Basis Team Steps)

shalabhkumar_8-1793947447375.png

Click on LDAP Server.

shalabhkumar_9-1793947472546.png

Server Name—-will be LDAP Server IP.
Server Port—-389 is LDAP Port.
Username is—-Service AD Account SVC-GLOBE-SID.
Password——-Service Account Password.
Then Validate Configuration If password is correct Connection Test Successful will come.

shalabhkumar_10-1793947538430.png

Step 6.1 Now Login on NWA Configuration Authentication and Single Sign-On.

shalabhkumar_11-1793947613523.png

Click on SPNEGO Add Manually Next

shalabhkumar_12-1793947677112.png

shalabhkumar_13-1793947691082.png

On the Pop-up window provide Realm Name as “Test-ABC” and description DEV.
Click Next
On Principal Name screen provide Principal Name as “Service Username-<SID>-SPNego” where <SID> is system for which we are running wizard and its password.
Click Next

shalabhkumar_14-1793947745563.png

SVC-GLOBE-DEV is Service username which is created in AD.

shalabhkumar_15-1793947772277.png

shalabhkumar_16-1793947788910.png

Finish.

shalabhkumar_17-1793947861410.png

You need to Enable it after Finish.

shalabhkumar_18-1793947885419.png

Step 7  You need to import keytab file here which AD Team will provide to you.

shalabhkumar_19-1793947923569.png

shalabhkumar_20-1793947939643.png

shalabhkumar_21-1793947955456.png

Press Ok.

shalabhkumar_0-1793948222217.png

Step 7 Now click on Authentication Tab

shalabhkumar_1-1793948267017.png

Select ticket and below red bracket on right bottom side option should be selected.

shalabhkumar_2-1793948299419.png

Step 8 Take SAP Application restart.

Take SAP Application restart.
stopsap

shalabhkumar_3-1793948373315.png

Now Start Application.
startsap

shalabhkumar_5-1793948465648.png

shalabhkumar_4-1793948435645.png

Step 8.1 Monitor the Process

shalabhkumar_6-1793948509886.png

Step 9 Now run this URL https://host.FQDN:port/irj/portal

it will not ask you Username and password. This URL will open without password.
You can see Top right this URL is opened with my ID because my User ID is created in AD.

shalabhkumar_8-1793948624517.png

Step 9.1 

Now i will run User Admin URL. I am facing below error because I logged in with my LDAP User which is created in AD and this User ID don’t have Roles to login in User Admin URL.

shalabhkumar_9-1793948686547.png

Below SAP Note is Solution of above error message.
3255517 – AS Java NetWeaver Administrator not available – Caller Administrator not authorized.
Now you can check my ID in User Admin.
See my ID is in LDAP Data Source and I can logon in NWA / IRJ / user admin URL without entering password.

shalabhkumar_10-1793948790116.png

You can see in my ID. In my don’t have any Roles. If you need to login with your LDAP ID in NWA or user admin portal you need to assign some role like NWA_SUPERADMIN but take approval from your customer that we are assigning this role in my LDAP ID.

Step 9.2

Now I will show you NWA page. It is login with my LDAP ID.
https://hostname:Port/nwa

shalabhkumar_11-1793948994965.png

You do not have access to the applications assigned to this profile either due to a lack of permissions or because the applications are not usable on this system.
Solution of above error message.
2396612 – You do not have access to the applications assigned to this profile

Step 9.3  If you want to login in any NetWeaver URL Like Start Page, NWA, UME, IRJ or NWA.

You need to Launch URL in Incognito Mode like below.

shalabhkumar_12-1793949093994.png

Now you need to press esc button 4 to 5 times, and you will see below Page to log in NWA.

shalabhkumar_13-1793949123973.png

Start Page opened in Incognito Mode and SSL also configured.

shalabhkumar_14-1793949145000.png

SPENGO has been configured.

Step 10 I was faced one error message while configuring the SPNEGO.

shalabhkumar_15-1793949205786.png

Could not validate SPNEGO token.
[EXCEPTION]
java.lang.Exception: Checksum error.
You can find error messages in default.trc
Solution is 1568553 – [AS Java] SPNego SSO fails with Checksum error

shalabhkumar_16-1793949255513.png

Conclusion of SSO SPNEGO Authentication.

SSO with SPNEGO provides secure and seamless authentication by allowing users to access SAP applications using their Windows/Active Directory credentials without repeatedly entering a username and password. It improves user experience, strengthens security, and simplifies authentication management.

 

 

“}]] 

  Read More Technology Blog Posts by Members articles 

#abap

By ali

Leave a Reply