vCenter Server 8.0U3C fails w/USER_NOT_FOUND
Describe the bug
After successfully following the vCenter Server configuration instructions to setup Authentik as External IdP, when attempting to login using a user within the Authentik authorized group, it fails on the vCenter Server application with USER_NOT_FOUND as you can see from the federation-service.log log within vCenter Server Appliance.
2025-01-04T01:40:37,897 INFO vc.williamlam.local:federation (federation-business-pool-0) [CUSTOMER;-;192.168.30.80;20550bea-0cca-44f1-bf19-9d92794bc47c;-;-] com.vmware.vidm.federation.login.context.LoginContextManager - Created new login context with id: b3e4ca47-93e6-4c1d-82ff-9d37e81479ad
2025-01-04T01:40:51,957 INFO vc.williamlam.local:federation (federation-business-pool-0) [CUSTOMER;-;192.168.30.80;77331c8c-3a40-4e25-855a-fd15ed1b2df3;-;-] com.vmware.vidm.federation.login.context.LoginContextManager - Loaded login context: b3e4ca47-93e6-4c1d-82ff-9d37e81479ad
2025-01-04T01:40:52,764 INFO vc.williamlam.local:federation (federation-business-pool-0) [CUSTOMER;-;192.168.30.80;77331c8c-3a40-4e25-855a-fd15ed1b2df3;-;b3e4ca47-93e6-4c1d-82ff-9d37e81479ad] com.vmware.vidm.federation.utils.MetricsPublisherUtil - OIDC authentication successful
2025-01-04T01:40:52,776 INFO vc.williamlam.local:federation (federation-business-pool-0) [CUSTOMER;-;192.168.30.80;77331c8c-3a40-4e25-855a-fd15ed1b2df3;-;b3e4ca47-93e6-4c1d-82ff-9d37e81479ad] com.vmware.vidm.federation.login.processor.AuthResponseUserResolver - Fetching user for jit login context: b3e4ca47-93e6-4c1d-82ff-9d37e81479ad on attribute [email protected], domains: [williamlam.local]
2025-01-04T01:40:52,800 WARN vc.williamlam.local:federation (ForkJoinPool-2-worker-91) [CUSTOMER;-;192.168.30.80;77331c8c-3a40-4e25-855a-fd15ed1b2df3;-;b3e4ca47-93e6-4c1d-82ff-9d37e81479ad] com.vmware.vidm.federation.login.processor.AuthResponseUserResolver - User fetching exception with nameId [email protected], nameIdFormat ExternalId, and domains [williamlam.local], user not found
2025-01-04T01:40:52,801 INFO vc.williamlam.local:federation (federation-business-pool-0) [CUSTOMER;-;192.168.30.80;77331c8c-3a40-4e25-855a-fd15ed1b2df3;-;b3e4ca47-93e6-4c1d-82ff-9d37e81479ad] com.vmware.vidm.federation.login.LoginEventServiceAspect - Failing login. contextUuid: b3e4ca47-93e6-4c1d-82ff-9d37e81479ad, exception: com.vmware.vidm.federation.login.AccessDeniedException: Access denied with reason code: USER_NOT_FOUND, isAuthenticationForced: false
2025-01-04T01:40:52,801 INFO vc.williamlam.local:federation (federation-business-pool-0) [CUSTOMER;-;192.168.30.80;77331c8c-3a40-4e25-855a-fd15ed1b2df3;-;b3e4ca47-93e6-4c1d-82ff-9d37e81479ad] com.vmware.vidm.federation.utils.MetricsPublisherUtil - Login failed due to reason: USER_NOT_FOUND
2025-01-04T01:40:52,801 INFO vc.williamlam.local:federation (federation-business-pool-0) [CUSTOMER;-;192.168.30.80;77331c8c-3a40-4e25-855a-fd15ed1b2df3;-;b3e4ca47-93e6-4c1d-82ff-9d37e81479ad] com.vmware.vidm.federation.exception.handler.LoginExceptionHandler - Access denied for login context: b3e4ca47-93e6-4c1d-82ff-9d37e81479ad
2025-01-04T01:41:20,470 INFO vc.williamlam.local:federation (scheduled-metrics-publisher-1) [-;-;-;-;-;-] com.vmware.vidm.common.metrics.publisher.DefaultMetricsPublisher - Metric published: com.vmware.vidm.common.metrics.model.Metrics@18a1bc98
To Reproduce https://docs.goauthentik.io/integrations/services/vmware-vcenter/
Under OAuth2 Provider, I've tried the default setting for Subject mode as well as Based on the User's username and User's email but behavior is the same.
Expected behavior Successfully logging into vCenter Server vSphere UI
Screenshots
Logs N/A
Version and Deployment (please complete the following information):
- authentik version: 2024.12.1
- Deployment: docker-compose
I've seen this happen temporarily when the SCIM sync hasn't finished and as such the user doesn't exist in vcenter yet
Sorry to add a comment on a closed issue, but... What ended up being the ultimate fix and final config for you that works? @lamw
The issue was that the users from Authentik weren't fully sync'ed and while I had saw some "warnings", I didn't realize that actually prevented the sync from completing and hence users weren't seen in vCenter Server. The issue was that the emails associated w/my users had the same login domain (which apparently Authentik isn't happy about), once I updated the email to some other domain, sync'ing worked
For full detail write-up you can check out https://williamlam.com/2025/01/vcenter-server-identity-federation-with-authentik-identity-provider.html
Thanks for the fast response. I actually followed that guide. I run my email server and domain with the same domain name. That is going to make things challenging since I am using AD in Federation as my login ID's. We can take this to Discord or something else if its easier and you are interested in helping lol. 👍
I don't know why there's that constraint that IdP domain can't be in email ... but I saw that in logs and hence I figured out why the sync was failing. Perhaps you can raise this issue and get feedback from Engr team
Hello @lamw. This may be a bit late, but I'm having the exact same issue that you were, and I already did the exact same thing that you did in your guide.
@KingHenry6666 any lucky? I'm also stuck with the same issue.
I think they're shipping a fix for it