Note that there are some explanatory texts on larger screens.

plurals
  1. POCan i put 3 different authentication schemes in same spring security configuration?
    primarykey
    data
    text
    <p>My requirement is to provide:</p> <ol> <li>Userid password based authentication.</li> <li>Open id based authentication</li> <li>Url based authentication (its a custom sso impl we have)</li> </ol> <p>in the same project.</p> <p>I have tried to plug in Spring security into an existing project as (code stripped down for simplicity): </p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.1.xsd"&gt; &lt;http auto-config="false"&gt; &lt;remember-me user-service-ref="rememberMeUserService" key="some custom key" /&gt; &lt;!-- TODO: Key made for testing reasons.... --&gt; &lt;intercept-url pattern='/mainApplication/Main screen.html' access="ROLE_ADMIN"/&gt; &lt;intercept-url pattern='/**' filters="none"/&gt; &lt;!-- Allow entry to login screen --&gt; &lt;openid-login authentication-failure-url="/Login.html?error=true" default-target-url="/mainApplication/Main screen.html" user-service-ref="openIdUserService"/&gt; &lt;form-login login-page="/Login.html" authentication-failure-url="/Login.html?error=true" always-use-default-target="true" default-target-url="/mainApplication/Main screen.html"/&gt; &lt;/http&gt; &lt;beans:bean id="rememberMeUserService" class="mypackage.CustomUserService"&gt; &lt;beans:property name="usersService" ref="usersService"&gt;&lt;/beans:property&gt; &lt;/beans:bean&gt; &lt;!-- Common login shared entry-point for both Form and OpenID based logins --&gt; &lt;beans:bean id="entryPoint" class="org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint"&gt; &lt;beans:property name="loginFormUrl" value="/Login.html" /&gt; &lt;/beans:bean&gt; &lt;authentication-manager alias="authenticationManager"/&gt; &lt;beans:bean id="MyCustomAuthenticationProvider" class="mypackage.CustomAuthenticationProvider"&gt; &lt;custom-authentication-provider /&gt; &lt;beans:property name="usersService" ref="usersService"&gt;&lt;/beans:property&gt; &lt;/beans:bean&gt; &lt;beans:bean id="openIdAuthenticationProvider" class="org.springframework.security.providers.openid.OpenIDAuthenticationProvider"&gt; &lt;custom-authentication-provider /&gt; &lt;beans:property name="userDetailsService" ref="openIdUserService"/&gt; &lt;/beans:bean&gt; &lt;beans:bean id="openIdUserService" class="mypackage.OpenIDUserDetailsService"&gt; &lt;beans:property name="usersService" ref="usersService"/&gt; &lt;/beans:bean&gt; &lt;!-- Great, now i want to include SSO based sign on --&gt; &lt;!-- need to intercept a url of the form : /myApp/customLogin/&lt;key&gt; where &lt;key&gt; is my token key --&gt; &lt;/beans:beans&gt; </code></pre> <p>as mentioned above, i need to track a url of the form : /myApp/customLogin/12345 where 1235 is the token key, we were initially using (code stripped down for simplicity)</p> <pre><code>&lt;servlet-mapping&gt; &lt;servlet-name&gt;mySSOCapture&lt;/servlet-name&gt; &lt;url-pattern&gt;/myApp/*&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;MyServlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/MyServlet&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; </code></pre> <p>What should i do here to enable spring security to help me manage this third authentication scheme ?</p> <p>a corollary question is : can i have many authentication providers in the same project ? if yes, then how can they be matched to different functionalities (eg one providing url based authentication, one providing anonomous auth, etc) ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload