Skip to content
Permalink
Browse files
[JENKINS-11746] At least fail with a descriptive error message, reuse…
…d from 3686396.
  • Loading branch information
jglick committed Oct 23, 2012
1 parent ac32854 commit 67c3d2d2109e8b815ede6768fb739389e66d7657
Showing with 5 additions and 13 deletions.
  1. +5 −13 src/main/java/hudson/plugins/openid/OpenIdSsoSecurityRealm.java
@@ -26,6 +26,7 @@
import com.cloudbees.openid4java.team.TeamExtensionFactory;
import hudson.Extension;
import hudson.model.Descriptor;
import hudson.model.Failure;
import hudson.model.Hudson;
import hudson.model.User;
import hudson.security.SecurityRealm;
@@ -43,30 +44,18 @@
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.StaplerRequest;
import org.openid4java.OpenIDException;
import org.openid4java.association.AssociationException;
import org.openid4java.consumer.ConsumerException;
import org.openid4java.consumer.ConsumerManager;
import org.openid4java.consumer.InMemoryConsumerAssociationStore;
import org.openid4java.consumer.InMemoryNonceVerifier;
import org.openid4java.consumer.VerificationResult;
import org.openid4java.discovery.Discovery;
import org.openid4java.discovery.DiscoveryException;
import org.openid4java.discovery.DiscoveryInformation;
import org.openid4java.discovery.UrlIdentifier;
import org.openid4java.message.AuthFailure;
import org.openid4java.message.AuthImmediateFailure;
import org.openid4java.message.AuthSuccess;
import org.openid4java.message.MessageException;
import org.openid4java.message.ParameterList;
import org.openid4java.util.HttpClientFactory;
import org.openid4java.util.ProxyProperties;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.List;
import java.util.logging.Logger;

/**
* SSO based on OpenID by fixing a provider.
@@ -189,7 +178,10 @@ protected HttpResponse onSuccess(Identity id) throws IOException {
* This is where the user comes back to at the end of the OpenID redirect ping-pong.
*/
public HttpResponse doFinishLogin(StaplerRequest request) throws IOException, OpenIDException {
return OpenIdSession.getCurrent().doFinishLogin(request);
OpenIdSession session = OpenIdSession.getCurrent();
if (session==null)
throw new Failure(Messages.OpenIdLoginService_SessionNotFound());
return session.doFinishLogin(request);
}

@Extension

0 comments on commit 67c3d2d

Please sign in to comment.