Note that there are some explanatory texts on larger screens.

plurals
  1. POBasic Authentication in Spring Security( authentication failure message)
    primarykey
    data
    text
    <p>I am developing website(HTML, javascript, jQuery, Ajax, css) in which, I am using basic authentication in spring in server side. I am sending Basic="Base64 Endcoded Username &amp; password" in Authorization header of HTTP request. Login works fine on correct username &amp; password. But on failure, it shows me a default prompt to enter a username &amp; password. What can I do to so that prompt is not shown, Instead I should get a error code. So that, I can display proper failure message. </p> <hr> <p>Spring Security</p> <p>http://www.springframework.org/schema/beans/spring-beans-3.0.xsd <a href="http://www.springframework.org/schema/security" rel="nofollow">http://www.springframework.org/schema/security</a> <a href="http://www.springframework.org/schema/security/spring-security-3.0.3.xsd" rel="nofollow">http://www.springframework.org/schema/security/spring-security-3.0.3.xsd</a>"></p> <pre><code>&lt;http create-session="never"&gt; &lt;intercept-url pattern="/rest/user*" access="ROLE_USER" /&gt; &lt;logout logout-success-url="/index.jsp" invalidate-session="true" /&gt; &lt;http-basic /&gt; &lt;/http&gt; &lt;authentication-manager&gt; &lt;authentication-provider&gt; &lt;password-encoder hash="md5"/&gt; &lt;jdbc-user-service data-source-ref="dataSource" users-by-username-query=" select UserName as username, Password as user_password,true from User where username=?" authorities-by-username-query=" select UserName as username,'ROLE_USER' from User where username=?" /&gt; &lt;/authentication-provider&gt; &lt;/authentication-manager&gt; </code></pre> <p></p>
    singulars
    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