Forum Discussion

Bill_Kehn_27007's avatar
Icon for Nimbostratus rankNimbostratus
Nov 10, 2017

Kerberos SSO to IIS Web Application

We are trying to implement a clientless solution in which a user which is part of the domain, and accessing a web application from a machine in the same domain, would automatically be authenticated without user intervention.


I know there are lots of articles out there and I have read some tremendous write-ups on how this all works from Kevin Stewart and we believe we have most of the framework in place.


What is happening, it seems, is that a 401 authentication dialog is appearing to the user instead of the client requesting a kerberos ticket from AD and presenting it to the F5 APM to decrypt and process with the installed keytab file.


Specifically this is what I have for configuration:


Web site:



This hostname is represented in DNS and can be resolved both forward/reverse.


Client side accounts:


bill@synacktek.local - my AD domain account logged into a domain machine for testing. HTTP/sso-test.synacktek.local - account used for keytab file creation, imported to the F5, do I need to set kerberos delegation for this?




SSO Side account: HOST/kerberos-server.synacktek.local - SSO account for kerberos. Performed setspn and assigned delegation in AD for this to access web service WINDNS1 (this is where web server is located).



F5 SSO configuration which uses this account:



APM Policy:


Has 401 configured for negotiate, with branch feeding kerberos authentication (client side?) After this I have a couple of message boxes, the kerberos OK feeds a variable assign to help populate the sso side of the proxy configuation.



When connecting to the web URL I always get prompted with the 401 authentication.


I am certainly missing something here but do not know what it is.


Appreciate any help! Thx Bill


13 Replies

  • Can i ask for some clarification?

    In the commands below, there is no command for "setspn _ -A HTTP/..." nor the creation of a keytab file. Was that still the case? 

    Can you use the same config and apply it to different virtual servers (to do APM Kerberos) to different URL's?

  • Hi,

    when working with kerberos SSO, I use following powershell commands:

    Create kerberos SSO account
    New-ADUser -Name "APM Delegation Account" -UserPrincipalName svc_f5_krb@demo.local -SamAccountName "svc_f5_krb" -PasswordNeverExpires $true -Enabled $true -AccountPassword (ConvertTo-SecureString -AsPlainText "P@ssw0rd" -Force)
    Add ServicePrincipalName attribute (same as when using setspn command)
    Set-AdUser -Identity svc_f5_krb -ServicePrincipalNames @{Add="host/svc_f5_krb.demo.local"} 
    Add delegation to application SPN http/app1.demo.local
    Get-AdUser -Identity svc_f5_krb | Set-ADObject -Add @{"msDS-AllowedToDelegateTo"="http/app1.demo.local"} 
    Configure Kerberos delegation parameters
    Set-ADAccountControl -Identity svc_f5_krb -TrustedForDelegation $false
    Set-ADAccountControl -Identity svc_f5_krb -TrustedToAuthForDelegation $true 

    Then, in APM, I create Kerberos SSO with following tmsh command:

    Kerberos SSO for Machine account kerberos SSO
    create apm sso kerberos SSO_KRB_machine { account-name svc_f5_krb account-password P@ssw0rd kdc realm DEMO.LOCAL user-realm-source session.krbsso.last.domain username-source session.krbsso.last.username }
    Kerberos SSO for Application Pool account kerberos SSO
    create apm sso kerberos SSO_KRB_AppPool { account-name svc_f5_krb account-password P@ssw0rd kdc realm DEMO.LOCAL spn-pattern HTTP/%h user-realm-source session.krbsso.last.domain username-source session.krbsso.last.username } 

    I these commands, I set 2 variables:

    session.krbsso.last.domain =

    Session variable

    session.krbsso.last.username =

    AD Attribute sAMAccountName

    Last week I provided powershell commands to a customer to create an AD for training. All trainee configured the LAB successfully!

    The user account provided may work in AD forest with single domain. In AD forest with multiple domains, the account name format must be host/svc_f5_krb.demo.local

  • Stephan_Mierau_'s avatar
    Historic F5 Account

    I would suggest that you do a packet capture and look if the client is fetching a kerberos token and presents it to the APM


    • boneyard's avatar
      Icon for MVP rankMVP

      what are you filtering on for the packet capture? might be it goes to a system you don't expect.


    • Bill_Kehn_27007's avatar
      Icon for Nimbostratus rankNimbostratus

      That's the issue, I am pretty sure (unless I am way off here) that my F5 APM (aaa/sso) config is good. There is something going on in the AD world that I don't understand and am really having a hard time figuring out how to troubleshoot. When I do a packet capture on the F5, I don't see any kerberos traffic being sent toward the domain controller for SSO.




    • boneyard's avatar
      Icon for MVP rankMVP

      that failed to get ticket can't be ok, you have to correct setup there?


  • which browsers have you tried? i believe you need to do something there also, in IE set it as trusted website for example.


  • Output from client:



    APM Log (there is not much here although I have everything set to debug):