title: How to disable keycloak login page prompt when there is no authentication but just immediately return 401?
body: <p>I have a Spring Boot application with Keycloak, and I have no issues with it in the normal case (access_token is provided)</p>
  <p>However, if the requests do not have any authentication in the header, Keycloak returns a login page with a response of 400 Bad Request.</p>
  <p>I expected it to return 401 Unauthorized if there is no Authentication header in the request.
  How to configure Keycloak to do this?</p>
  <p>My application.properties file in my spring application, in case it helps:</p>
  <pre><code>keycloak.auth-server-url=http://192.168.1.251:8080/auth
  keycloak.realm=applicationName
  keycloak.resource=applicationName-client
  keycloak.public-client=true
  
  keycloak.security-constraints[0].authRoles[0]=admin-user
  keycloak.security-constraints[0].authRoles[1]=standard-user
  keycloak.security-constraints[0].securityCollections[0].methods[0]=GET
  keycloak.security-constraints[0].securityCollections[0].patterns[0]=/devices
  keycloak.security-constraints[1].authRoles[0]=admin-user
  keycloak.security-constraints[1].securityCollections[0].methods[0]=POST
  keycloak.security-constraints[1].securityCollections[0].patterns[0]=/devices
  keycloak.security-constraints[2].authRoles[0]=admin-user
  keycloak.security-constraints[2].authRoles[1]=standard-user
  keycloak.security-constraints[2].securityCollections[0].methods[0]=GET
  keycloak.security-constraints[2].securityCollections[0].methods[1]=PATCH
  keycloak.security-constraints[2].securityCollections[0].patterns[0]=/device/*
  keycloak.security-constraints[3].authRoles[0]=admin-user
  keycloak.security-constraints[3].securityCollections[0].methods[0]=PUT
  keycloak.security-constraints[3].securityCollections[0].methods[1]=DELETE
  keycloak.security-constraints[3].securityCollections[0].patterns[0]=/device/*
  </code></pre>
  <p>In case this may also help, I get the access token using the following url:</p>
  <pre><code>http://192.168.1.251:8080/auth/realms/applicationName/protocol/openid-connect/token
  </code></pre>
  <p>With the following parameters:</p>
  <pre><code>client_id : applicationName-client
  username: user
  password: password1234
  grant_type: password
  client_secret: &lt;secret&gt;
  scope: openid
  </code></pre>