theonedev/onedev · error · AuthenticationException

Unable to find SSO provider:

Error message

Unable to find SSO provider: 

What it means

SsoProcessPage resolves the SSO provider by name from the URL via SsoProviderService.find(providerName). When no provider with that name is configured it throws AuthenticationException('Unable to find SSO provider: ' + providerName), since the login flow cannot proceed without a matching provider configuration.

Source

Thrown at server-core/src/main/java/io/onedev/server/web/page/security/SsoProcessPage.java:132

				throw new RedirectToUrlException(redirectUrlAfterLogin);		
			else
				throw new RestartResponseException(HomePage.class);
		}
		
		stage = params.get(PARAM_STAGE).toString();
		
		try {
			String providerName = params.get(PARAM_PROVIDER).toString();

			providerModel = new LoadableDetachableModel<SsoProvider>() {
				@Override
				protected SsoProvider load() {
					return OneDev.getInstance(SsoProviderService.class).find(providerName);
				}
			};
			
			if (getProvider() == null) 
				throw new AuthenticationException(_T("Unable to find SSO provider: ") + providerName);
			
			if (stage.equals(STAGE_INITIATE)) {
				String redirectUrlAfterLogin;
				Url url = RestartResponseAtInterceptPageException.getOriginalUrl();
				if (url != null && url.toString().length() != 0) 
					redirectUrlAfterLogin = url.toString();
				else 
					redirectUrlAfterLogin = RequestCycle.get().urlFor(HomePage.class, new PageParameters()).toString(); 
				Session.get().bind();
				Session.get().setAttribute(SESSION_ATTR_REDIRECT_URL, redirectUrlAfterLogin);
				throw new RedirectToUrlException(getProvider().getConnector().buildAuthUrl(providerName));
			} else {
				authenticated = getProvider().getConnector().handleAuthResponse(providerName);
				var aUser = transactionService.call(() -> {					
					var ssoAccount = ssoAccountService.find(getProvider(), authenticated.getSubject());
					if (ssoAccount != null) {
						var user = ssoAccount.getUser();
						if (user.getType() != ORDINARY || user.isDisabled()) {

View on GitHub (pinned to d44925c47c)

Solutions

  1. Check the exact provider name under Admin > SSO Providers and correct the URL.
  2. Recreate the SSO provider if it was deleted, keeping the same name as old links.
  3. Update bookmarks/login-page links to the current provider name.
  4. Verify the same SSO provider config exists on all nodes if running a cluster.
Defensive patterns

Strategy: fallback

Validate before calling

SsoProvider p = OneDev.getInstance(SsoProviderService.class).find(providerName);
if (p == null) { /* fall back to standard login page */ }

Try / catch

try {
  startSsoLogin(providerName);
} catch (AuthenticationException e) {
  setResponsePage(SignInPage.class);
}

Prevention

When it happens

Trigger: Visiting the SSO process URL with a providerName that does not match any configured SSO provider — provider renamed or deleted after the URL/bookmark was created, typo in the URL, or configuration not restored after migration/upgrade.

Common situations: Saved bookmark to an SSO login that was since removed or renamed in Admin > SSO Providers; cluster node with outdated/out-of-sync configuration; casing mismatch in provider name.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06). Data as JSON: /api/errors/8535f6435bd7fd5b. Report an issue: GitHub.