Avatar billede fredand Forsker
26. maj 2009 - 14:41 Der er 3 kommentarer og
1 løsning

How to specify error-page for 401?

Hello!

We have set up our jboss 4.3 with BasicAuthenticator.
And we protect all of the site area with that.

So if we try to access the app we get a login-form-popup (user and password).
This works fine.

But we also would like to present an certain error-page if the login fails.

So we added the following into our web.xml
  <error-page>
    <error-code>401</error-code>
    <location>/not_autherized.jsp</location>
  </error-page>
..but this resulted in that the error-page is shown right away instead of any login-form-popup.

I "guess" the logic inside jboss might work like this then:

access_webapp()
{

try
{
  showWebUrl()
}
catch(NotAutherizedExeption nae)
{
  if(Error_Page_Spec_In_Web_xml_Exist())
  {
  showErrorPage()
  }
  else
  {
  showBasicAuthirizationPopUp()
  }
}

}

If you got any idea how to specify the not_autherized.jsp only if the login fails please let me know!

Best reagrds
Fredrik
Avatar billede arne_v Ekspert
26. maj 2009 - 15:17 #1
No possibility of using form based authentication instead of basic authentication ?

(that would solve this problem)
Avatar billede fredand Forsker
26. maj 2009 - 15:34 #2
Hello!

You solved the problem then!

No we do not have that possibility, beacuse in the prod-env the Basic-auth will be "overridden" by something called AccessManger so we need tu use the Basic.

I disscussed this with some people over here and all this is then in the hand of the AM-config.

Since we do not are able to use form, this is not possible!

Please give a svar so I can reward you mate!

Best regards
Fredrik
Avatar billede arne_v Ekspert
03. juli 2009 - 22:37 #3
I think you should take point yourself here.
Avatar billede fredand Forsker
04. juli 2009 - 20:24 #4
Hello!
Ok!
I take your word for it!

Thanks any way!

Best regards
Fredrik
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester