Results 1 to 5 of 5

Thread: Basic Authentication without user input.

  1. #1
    Join Date
    Aug 2009
    Posts
    14

    Default Basic Authentication without user input.

    Hi,

    i am working on a web application and we dont use any login at all(public facing website) but in one part of the application we need to talk to the expernal payment engine to allow the user to pay and become a member. for this part once the user submit the payment in the external server it will post the response back to my application(not a browser post but server post) in which i need to do basic authentication for that partciular url. i am having a custom filter to initiate the authentication process but it asks the user to enter the credentials which i dont want but automatically pick up the uername,password configured in the autenticaion manager user service to use it.

    how can i do that? whats wrong in my configuration?

    attached part of the security.xml.
    Attached Files Attached Files

  2. #2

    Default Basic Authentication without user input.

    I also have the same problem .will someone help me how to bypass the spring provided login form?

  3. #3
    Join Date
    Aug 2006
    Posts
    129

    Default commons http with spring integration http

    Code:
    <int-http:outbound-gateway 
    		request-channel="http-requests"
    		extract-request-payload="true"
    		charset="UTF-8"
    		request-factory="template-client-factory"
    		url="${gateway.url}?{request}"
    		message-converters="http-template-message-converters"
    		http-method="GET"
    		expected-response-type="java.lang.String"
    		reply-channel="http-replies">
    		<int-http:uri-variable name="request" expression="headers['criteria-request']"/>
    	</int-http:outbound-gateway>
    		
    	
    	<bean id="template-client" class="org.apache.commons.httpclient.HttpClient"> 
            <constructor-arg ref="http-template-client-params"/> 
        </bean>
    		
    	 <bean id="template-client-factory" class="org.springframework.http.client.CommonsClientHttpRequestFactory"> 
            <constructor-arg ref="rim-template-client"/> 
        </bean>
    	 
    	 <bean id="template-credentials" class="org.apache.commons.httpclient.UsernamePasswordCredentials"> 
            <constructor-arg value="${gateway.username}"/> 
            <constructor-arg value="${gateway.password}"/> 
        </bean>
    and now :

    Code:
    factory.getHttpClient().getState().setCredentials(AuthScope.ANY, credentials);

  4. #4

    Default authorization with pre authentication

    This is not what I want exactly.
    Actually The problem is that I already have an application where login is done with struts 2 framework now I want to authorize the web resources with spring security without using spring provided login form .So how can I do this ?Can I get any working example?

  5. #5
    Join Date
    Aug 2006
    Posts
    129

    Default

    There is a sample application in the codebase which uses this approach, so get hold of the code from
    subversion and have a look at the application context file if you are interested. The code is in the
    samples/preauth directory

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •