goauthentik / goauthentik/authentik
SPNEGO and Windows AD
- Dominant language
- Python
- Stars
- 25.6k
- Forks
- 2k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 651
Description
### Describe the bug
I was not sure under which category to open this issue but settled it as a bug, feel free to change it if this was a mistake.
I do have a problem trying to use SPNEGO with Windows AD and even with extensive testing/trying, I could not figure out what is wrong.
I am not unfamiliar with SPNEGO and IWA and I already use it for services like Azure login, synology etc and they work reasonably well.
However, for authentik I could not get it to work. I will briefly explain the steps I took and do please let me know if I have gone wrong somewhere.
Created an AD user in DC then set the encryption settings for it
`Set-ADUser -Identity "authentik-spnego" -Replace @{'msDS-SupportedEncryptionTypes' = 24}`
set the SPN for Authentik for that user
`setspn -S HTTP/authentik.domain.com DOMAIN\authentik-spnego`
double checked the SPN
```
setspn -Q HTTP/authentik.domain.com
setspn -X
```
created a keytab
```
ktpass /princ HTTP/authentik.domain.com@DOMAIN.COM `
/mapuser DOMAIN\authentik-spnego `
/crypto AES256-SHA1 `
/ptype KRB5_NT_PRINCIPAL `
/pass "PASSWORD" `
/out C:\authentik-spnego.keytab
```
and lastly, get the base64 for that keytab
`[Convert]::ToBase64String([IO.File]::ReadAllBytes("C:\authentik-spnego.keytab"))`
My users are already synced with Entra SCIM protocol to the Authentik instance.
and in Authentik, setting up the Kerberos Source Federation
sync is disabled in Kerberos since it is not supported, then entered the keytab
Modified the **default-authentication-identification** stage and added Kerberos source
The chrome/brave and firefox settings are complete as described.
then testing this on a domain joined pc and the user logged in is a synced user
```
PS C:\Users\user> klist purge
Current LogonId is 0:0x19ea18
Deleting all tickets:
Ticket(s) purged!
PS C:\Users\user> klist get HTTP/authentik.domain.com
Current LogonId is 0:0x19ea18
A ticket to HTTP/authentik.domain.com has been retrieved successfully.
Cached Tickets: (2)
#0> Client: user @ DOMAIN.COM
Server: krbtgt/DOMAIN.COM @ DOMAIN.COM
KerbTicket Encryption Type: AES-256-CTS-HMAC-SHA1-96
Ticket Flags 0x40810000 -> forwardable renewable name_canonicalize
Start Time: 3/7/2026 23:30:13 (local)
End Time: 3/8/2026 9:30:13 (local)
Renew Time: 3/14/2026 23:30:13 (local)
Session Key Type: AES-256-CTS-HMAC-SHA1-96
Cache Flags: 0x1 -> PRIMARY
Kdc Called: DC2.domain.com
#1> Client: user @ DOMAIN.COM
Server: HTTP/authentik.domain.com @ DOMAIN.COM
KerbTicket Encryption Type: AES-256-CTS-HMAC-SHA1-96
Ticket Flags 0x40810000 -> forwardable renewable name_canonicalize
Start Time: 3/7/2026 23:30:13 (local)
End Time: 3/8/2026 9:30:13 (local)
Renew Time: 3/14/2026 23:30:13 (local)
Session Key Type: AES-256-CTS-HMAC-SHA1-96
Cache Flags: 0
Kdc Called: DC2.domain.com
```
I see that the ticket is issued with the correct address, domain and encryption
then testing it with curl
```
PS C:\Users\user> curl.exe -v --negotiate -u : https://authentik.domain.com/source/kerberos/ad-kerberos/
* Host authentik.domain.com:443 was resolved.
* IPv6: (none)
* IPv4: 172.31.255.20
* Trying 172.31.255.20:443...
* schannel: disabled automatic use of client certificate
* ALPN: curl offers http/1.1
* ALPN: server accepted http/1.1
* Established connection to authentik.domain.com (172.31.255.20 port 443) from 192.168.100.40 port 61603
* using HTTP/1.x
* Server auth using Negotiate with user ''
> GET /source/kerberos/ad-kerberos/ HTTP/1.1
> Host: authentik.domain.com
> Authorization: Negotiate YIIfghhdcxcgedrtgjjjiiihkiC9xIBAgIGCSqGSIb3EgECAgYKKwYBBAGCNwICHgYKKwYBBAGCNwICCqKCB6gEggekYIIHoAYJKoZIhvcSAQICAQBuggePMIIHi6ADAgEFoQMCAQ6iBwMFACAAAACjggWMYYIFiDCCBYSgAwIBBaERGw9LQVJHSUNJT0dMerwtr233qoAMCAQKhIzAhGwRIVFRQGxlhdXRoZWwerdsdcss3reVSWApnIg06dbzmClGGXVdIiDfXoZCRFrVxYEg+j0eQqXz/TETA6WRx84xvdb4i4rLrdGwsZX6RsmlqW5T2ZbBTMahXTRh6nXC7qTa+LPRYvWHxl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3ZYFvixjosAPhJRWXLyDsKh2A92wH2m6RgVO7KK6TO
> User-Agent: curl/8.16.0
> Accept: */*
>
* Request completely sent off
* schannel: remote party requests renegotiation
* schannel: renegotiating SSL/TLS connection
* schannel: SSL/TLS connection renegotiated
* schannel: remote party requests renegotiation
* schannel: renegotiating SSL/TLS connection
* schannel: SSL/TLS connection renegotiated
< HTTP/1.1 302 Found
< content-language: en
< content-length: 0
< content-type: text/html; charset=utf-8
< date: Sat, 07 Mar 2026 20:33:02 GMT
< location: /source/kerberos/ad-kerberos/?state=eziw58juU45UMu2Y
then error
same is true for firefox but it is not prompting for username and password.
Inspecting the requests in firefox
### How to reproduce
1. Steps explained above
### Expected behavior
Should just login
### Screenshots
_No response_
### Additional context
_No response_
### Deployment Method
Docker
### Version
2026.2.1
### Relevant log output
```shell
```
Contributor guide
Assessment
This issue has not been assessed yet.