It was my mistake in the login page because of which issue was occurring.
Resolved it. The authentication and authorization plugin is working fine.
Thanks a lot !!!
On Wednesday, 4 December 2013 17:19:31 UTC+5:30, swastb wrote:
>
> Was able to resolve this issue with jenkins deployed in jetty or in tomcat
> as ROOT.war . Sorry for updating so late. Thanks a lot to Robert and Jesse.
> I did the following
>
> 1. overridden getAuthenticationGatewayUrl
> @Override
> public String getAuthenticationGatewayUrl() {
> return "securityRealm/selectValues";
> }
> 2. Added a new method as
> doSelectValues(StaplerRequest req, StaplerResponse
> rsp,@Header("Referer") final String referer)
> {
> here redirected to my login page..
> // save the login userid and password in session
> if (req.getUserPrincipal() == null) {
> rsp.sendRedirect("login");
> return;
> }
> }
>
> 3. Added own custom login.jelly where added own j_username,j_password,from
> as hidden variable which im populating in my Realm code with the values
> which came from original login page. The login.jelly post is being
> redirected to j_acegi_security_check.
>
> Is there any wrong with this approach? Because facing one issue, i,e when
> i deploy the jenkins.war in tomcat without renaming to ROOT.war, the
> browser fails with 404 error after login, it tries to
> reach jenkins/securityRealm/j_acegi_security_check without going to
> authentication. I couldn't do much on PluginServletFilter , since not
> much confident on groovy script.
>
> On Wednesday, 30 October 2013 21:58:31 UTC+5:30, swastb wrote:
>>
>> Thanks a lot Robert and Jesse.. I will try with both of the options. I
>> will update once done..
>>
>>
>> On Wed, Oct 30, 2013 at 8:12 PM, Sandell, Robert <
>> [email protected]> wrote:
>>
>>> I guess you could do a semi hack and implement a PluginServletFilter [1]
>>> that looks at the referrer field of the http request and if that is the
>>> login form redirect the request to your custom page.
>>>
>>> The normal case for Jenkins is to redirect the user to whatever page it
>>> came from before going to the login form, so you’d loose that unless the
>>> filter also took a look at where the request was going.
>>>
>>>
>>>
>>> [1]
>>> https://wiki.jenkins-ci.org/display/JENKINS/Extension+points#Extensionpoints-hudson.util.PluginServletFilter
>>>
>>>
>>>
>>>
>>>
>>> *Robert Sandell*
>>>
>>> Software Tools Engineer - SW Environment and Product Configuration
>>>
>>> Sony Mobile Communications
>>>
>>>
>>>
>>> *From:* [email protected] [mailto:
>>> [email protected]] *On Behalf Of *swastb
>>> *Sent:* den 30 oktober 2013 14:19
>>> *To:* [email protected]
>>> *Subject:* Redirect to a custom page after successful login in jenkins
>>> using plugin
>>>
>>>
>>>
>>> Hi all,
>>>
>>> Im badly looking for this answer. Is it possible to redirect to a custom
>>> page after successful login in jenkins. Im able to write a custom
>>> authorization plugin. But after successful authentication there has to be
>>> an intermediate page between login page and views. Is it possible to
>>> achieve this using plugin?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Developers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>>
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Jenkins Developers" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/jenkinsci-dev/Tr1Ln3VK2g0/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> [email protected].
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.