<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">You can take a look at our examples for
      how to use ServletOAuthClient. Hopefully it could help with your
      usecase:<br>
<a class="moz-txt-link-freetext" href="https://github.com/keycloak/keycloak/tree/master/examples/demo-template/third-party">https://github.com/keycloak/keycloak/tree/master/examples/demo-template/third-party</a><br>
<a class="moz-txt-link-freetext" href="https://github.com/keycloak/keycloak/tree/master/examples/demo-template/third-party-cdi">https://github.com/keycloak/keycloak/tree/master/examples/demo-template/third-party-cdi</a><br>
      <br>
      Marek<br>
      <br>
      On 21.4.2015 12:14, Jérôme Blanchard wrote:<br>
    </div>
    <blockquote
cite="mid:CAPNq5vYA0E1HdwR4mUzF0R2SyfaUfGc+u4Pc4bFvYJwuuKX9RA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>Hi all, <br>
                  <br>
                </div>
                I'm trying to protect a servlet application which can be
                accessed either as anonymous user and as authenticated
                user. Some resources are protected and my application
                takes in charge the access control (not role based) so I
                can't use the war protection using role user constraint.<br>
              </div>
              In this case I've removed the role constraint in the
              web.xml and the keycloak wildfly (undertow) adapter let me
              access the application as unauthentified user (anonymous)
              which is perfect.<br>
            </div>
            What I want to handle on some AccessDeniedException is to
            redirect the user to the authentication server manually. In
            this case, user authentified an come back to the protected
            URL but is no more anonymous but a authentified user. <br>
          </div>
          Is ther is a way to handle this redirection to the
          authentication server manually (I don't know where to store
          the state variable allowing keycloak wildfly adapter to handle
          properly the auth redirect that include the code).<br>
          <br>
        </div>
        Best regards, Jérôme.<br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
keycloak-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></pre>
    </blockquote>
    <br>
  </body>
</html>