Announcement Announcement Module
Collapse
No announcement yet.
Basic Authentication without user input. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #2
    Basic Authentication without user input.

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

    Comment


    • #3
      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);

      Comment


      • #4
        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?

        Comment


        • #5
          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

          Comment

          Working...
          X