About captcha

2008-11-14
2013-05-08
  • sweet yonce

    sweet yonce - 2008-11-14

    Hi,
      I run the jguard-struts-example sucessfully,but the captcha on the logon page has a exception when I refresh the page in the IExploer,that exception like this:
    ====================================================================
    user= [ ] :  subject has got the permission name=permissionFromUser actions=/Captcha.do,ANY,GETpermission build from the user request implies  authorize phase
    104500 [http-9000-1] DEBUG net.sf.jguard.jee.authentication.http.AccessFilter  - doFilter() -  access authorized to /my_gaurd_fc/Captcha.do
    515104500 [http-9000-1] DEBUG net.sf.jguard.jee.authentication.http.CaptchaChallengeBuilder  -  CAPTCHA SERVICE=com.octo.captcha.service.image.DefaultManageableImageCaptchaService
    82104500 [http-9000-1] DEBUG net.sf.jguard.jee.authentication.http.CaptchaChallengeBuilder  - sessionID=8FBC693D80E2C042F0F35650300F3823
    119104610 [http-9000-1] WARN  org.apache.struts.util.PropertyMessageResources  -   Resource org/apache/struts/action/ActionResources_zh_CN.properties Not Found.
    265104610 [http-9000-1] WARN  org.apache.struts.util.PropertyMessageResources  -   Resource org/apache/struts/action/ActionResources_zh.properties Not Found.
    265104610 [http-9000-1] WARN  org.apache.struts.action.RequestProcessor  - Unhandled Exception thrown: class java.lang.ClassCastException
    500104610 [http-9000-1] FATAL net.sf.jguard.jee.authentication.http.AccessFilter  - java.lang.ClassCastException: java.lang.String cannot be cast to net.sf.ehcache.Element
    ====================================================================

      But there has no exception when I visit the logon page on first time,the debug log infomation like this:

    user= [ ] :  subject has got the permission name=permissionFromUser actions=/Captcha.do,ANY,GETpermission build from the user request implies  authorize phase
    101375 [http-9000-1] DEBUG net.sf.jguard.jee.authentication.http.AccessFilter  - doFilter() -  access authorized to /my_gaurd_fc/Captcha.do
    515101532 [http-9000-1] DEBUG net.sf.jguard.jee.authentication.http.CaptchaChallengeBuilder  - captcha service should be defined
    64102079 [http-9000-1] DEBUG net.sf.jguard.jee.authentication.http.CaptchaChallengeBuilder  -  CAPTCHA SERVICE=com.octo.captcha.service.image.DefaultManageableImageCaptchaService will be defined
    75102079 [http-9000-1] DEBUG net.sf.jguard.jee.authentication.http.CaptchaChallengeBuilder  - sessionID=8FBC693D80E2C042F0F35650300F3823
    119102750 [http-9000-1] DEBUG net.sf.jguard.jee.authentication.http.CaptchaChallengeBuilder  - challenge=Please type the word appearing in the picture
    122102750 [http-9000-1] DEBUG net.sf.jguard.jee.authentication.http.CaptchaChallengeBuilder  -  service=com.octo.captcha.service.image.DefaultManageableImageCaptchaService@5dbc82
    123104469 [http-9000-1] DEBUG net.sf.jguard.jee.authentication.http.AccessFilter  - uriWithQuery=/Logon.do
    438104469 [http-9000-1] DEBUG net.sf.jguard.jee.authentication.http.AccessFilter  - uriWithQuery=/Logon.do
    7682008-11-14 16:39:29 net.sf.jguard.ext.audit.AuditManager addEvent
    ====================================================================

    this instance will be happen in the register process.

    please help me,Thanks very much.

     
    • Charles Lescot

      Charles Lescot - 2008-11-16

      Hi,
      it seems that the problem comes from the CaptchaService (from the Jcaptcha library).
      if you use the jguard 1.0.3 jguard release, you should either try to upgrade to a newer version of jcaptcha with jguard 1.0.3, or upgrade to the latest jguard beta release with upgrade the jcaptcha  version.

      hope it helps,

      Charles.

       
    • sweet yonce

      sweet yonce - 2008-11-17

      ok,I had solve this problem with your suggestion, and it ran successfully,,...    :),  I used the jguard 1.0.3,  the version of jcaptcha with it is RC2 , then I download the newest of version of jcaptcha (RC6) ,everything is ok,,  
          thanks for your help , Charles

       
      • Charles Lescot

        Charles Lescot - 2008-11-17

        Hi,
        you're welcome!

        cheers,

        Charles.

         
    • sweet yonce

      sweet yonce - 2008-11-17

      Hi, Charles:
            thanks again for your help first.
            But I has a problem with jGuard, it is that how can I get the user ID in the "jg_user" table after I insert a new user by involed "am.createUser(st, stClone)" method, Becuase I want to get the new user ID to do some own business operation , I kown that we can select it with its "Login" credential, but I try to find a way to get it from involving the "am.createUser" method.
            Can I get the user id by doing it?
      Thanks very much.

       
      • Charles Lescot

        Charles Lescot - 2008-11-19

        Hi,
        if you want to know the credential id (credential) of the user (Subject), you ca do it like this:
        JGuardCredential credentialId = SubjectUtils.getIdentityCredential(subject ,authenticationManager);
        String id = (String)credentialId.getValue();
        it will return the "functional id" (i.e not the row id of the database).
        note that in the jguard 1.1.x product line (in beta stage), a special credential (persistenceId) can also be grabbed.

        hope it helps,

        Charles.

         
    • sweet yonce

      sweet yonce - 2008-11-20

      Thanks ,Charles.
         you are very kind.
         I will try it .

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks