[JIRA] [github-oauth-plugin] (JENKINS-34894) Jenkins github oAuth breaks UI in anonymous login

11 views
Skip to first unread message

ronabop@gmail.com (JIRA)

unread,
May 17, 2016, 4:27:01 PM5/17/16
to jenkinsc...@googlegroups.com
Ronald Gundlach-Chmara created an issue
 
Jenkins / Bug JENKINS-34894
Jenkins github oAuth breaks UI in anonymous login
Issue Type: Bug Bug
Assignee: Sam Gleske
Components: github-oauth-plugin
Created: 2016/May/17 8:26 PM
Environment: Jenkins 2.5, GitHub oAuth 0.23
Priority: Major Major
Reporter: Ronald Gundlach-Chmara

Seeing "java.lang.ClassCastException: org.acegisecurity.providers.anonymous.AnonymousAuthenticationToken cannot be cast to org.jenkinsci.plugins.GithubAuthenticationToken" errors on Jenkins 2.5, GitHub oAuth 0.23 with the user interface images (i.e. http://jenkins/static/0e8678ad/images/32x32/red.png ) when users are anonymous.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

ronabop@gmail.com (JIRA)

unread,
May 17, 2016, 4:30:01 PM5/17/16
to jenkinsc...@googlegroups.com
Ronald Gundlach-Chmara commented on Bug JENKINS-34894
 
Re: Jenkins github oAuth breaks UI in anonymous login

Disabling 243, as usggested in a possibly related bug, did not fix.

JENKINS_JAVA_OPTIONS="-Dhudson.model.User.SECURITY_243_FULL_DEFENSE=false"

ronabop@gmail.com (JIRA)

unread,
May 17, 2016, 6:59:01 PM5/17/16
to jenkinsc...@googlegroups.com
Disabling 243, as  usggested  suggested  in a possibly related bug, did not fix.

JENKINS_JAVA_OPTIONS="-Dhudson.model.User.SECURITY_243_FULL_DEFENSE=false"

sam.mxracer@gmail.com (JIRA)

unread,
May 18, 2016, 1:17:01 PM5/18/16
to jenkinsc...@googlegroups.com

Can you describe more about how you reproduce it? I have no idea how to authenticate with AnonymousAuthenticationToken. Please describe how you've configured Jenkins with OAuth and any curl commands or other commands you're using to trigger the error.

ronabop@gmail.com (JIRA)

unread,
May 18, 2016, 2:55:01 PM5/18/16
to jenkinsc...@googlegroups.com

Environment details: A Local GitHub Enterprise 2.6.1 install is the auth verification source. Using GitHub Committer Authorization Strategy. Attached screenshot links show settings used for security/auth, and settings used for jenkins github config. (There is a lab install, and a corp install, I have lab for testing).

Jenkins GitHub settings (in case they're relevant):
https://www.dropbox.com/s/xah9mth12ip1e96/GitHuboAuthsettings.png?dl=0
In this link, the generic "GitHub Servers" , there is the lab server used for local authentication, and in "GitHub Enterprise Servers", there are the lab and production servers. (Attempting to remove the lab server from the github servers has no effect.)

Jenkins GitHub in Security:
https://www.dropbox.com/s/ukxais4v5yj7hyz/GitHuboAuthsettings2.png?dl=0
In this link, the lab server is being used for GitHub oAuth, with GitHub Commiter Authorization strategy, with all options allowed save for 'Create Job.."

Longer stacktrace of the error:

java.lang.ClassCastException: org.acegisecurity.providers.anonymous.AnonymousAuthenticationToken cannot be cast to org.jenkinsci.plugins.GithubAuthenticationToken

at org.jenkinsci.plugins.GithubSecurityRealm.loadUserByUsername(GithubSecurityRealm.java:639)
at hudson.model.User$UserIDCanonicalIdResolver.resolveCanonicalId(User.java:1050)
at hudson.model.User.get(User.java:395)
at hudson.model.User.get(User.java:364)
at jenkins.model.Jenkins.getUser(Jenkins.java:2642)
at hudson.plugins.greenballs.GreenBallFilter.mapImage(GreenBallFilter.java:67)
at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:48)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
....

ronabop@gmail.com (JIRA)

unread,
May 19, 2016, 3:27:01 PM5/19/16
to jenkinsc...@googlegroups.com

sam.mxracer@gmail.com (JIRA)

unread,
May 26, 2016, 4:40:09 AM5/26/16
to jenkinsc...@googlegroups.com

Released 0.24. It should be available in about 8 hrs in the update center. Or download it at https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/github-oauth/0.24/github-oauth-0.24.hpi

It handles the exception you experienced I believe. Please confirm for me if the issue is resolved.

st+jenkins-ci@st-g.de (JIRA)

unread,
May 26, 2016, 7:06:03 AM5/26/16
to jenkinsc...@googlegroups.com

Fixes this issue for me. Thanks a lot!

ronabop@gmail.com (JIRA)

unread,
May 31, 2016, 3:27:02 PM5/31/16
to jenkinsc...@googlegroups.com

UI elements now showing up correctly when not logged in. WIth 0.24.

sam.mxracer@gmail.com (JIRA)

unread,
May 31, 2016, 3:58:03 PM5/31/16
to jenkinsc...@googlegroups.com

Great! Thanks for reporting back everyone.

sam.mxracer@gmail.com (JIRA)

unread,
May 31, 2016, 3:59:03 PM5/31/16
to jenkinsc...@googlegroups.com
Sam Gleske resolved as Fixed
 
Change By: Sam Gleske
Status: Open Resolved
Resolution: Fixed
Reply all
Reply to author
Forward
0 new messages