Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using an improved version in SSO mode as well.
This would help diagnose issues like JENKINS-14760.
- Loading branch information
Showing
3 changed files
with
30 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package hudson.plugins.openid; | ||
|
||
import org.openid4java.discovery.DiscoveryException; | ||
import org.openid4java.discovery.yadis.YadisResolver; | ||
import org.openid4java.discovery.yadis.YadisResult; | ||
import org.openid4java.util.HttpCache; | ||
|
||
import java.util.Set; | ||
|
||
/** | ||
* {@link YadisResolver} with better error diagnosis. | ||
* @author Kohsuke Kawaguchi | ||
*/ | ||
class YadisResolver2 extends YadisResolver { | ||
/** | ||
* Improve the error diagnosis by reporting which URL had failed. openid4java as of 0.9.4 does not do that. | ||
*/ | ||
@Override | ||
public YadisResult discover(String url, int maxRedirects, HttpCache cache, Set serviceTypes) throws DiscoveryException { | ||
try { | ||
return super.discover(url,maxRedirects,cache,serviceTypes); | ||
} catch (DiscoveryException e) { | ||
throw new DiscoveryException("Failed to discover XRDS document from "+url, e.getErrorCode(), e); | ||
} | ||
} | ||
} |