[keycloak-user] Issue with Tomcat 8 adapter ?

Nic Grange nicolas.grange at retrievercommunications.com
Mon Nov 2 00:31:42 EST 2015


Hi Harsh,

Your problem is most likely caused by duplicate security-constraints for the same url-pattern (/*).
This used to be in one of the older versions of the documentation but was updated with https://issues.jboss.org/browse/KEYCLOAK-1724. 
Try just removing the second <security-constraint> in your web.xml and retest to see if it is the problem.

Cheers,
Nic


>
>Message: 4
>Date: Sun, 1 Nov 2015 21:12:23 -0700
>From: harsh mahey <harshmahey at gmail.com>
>Subject: [keycloak-user] Issue with Tomcat 8 adapter ?
>To: keycloak-user at lists.jboss.org
>Message-ID:
>	<CA+YyFz5s=CEYn7PsqnyutMXUYhXzGr3yWbNtEXRJaEuOv01zRw at mail.gmail.com>
>Content-Type: text/plain; charset="utf-8"
>
>Hi guys,
>Has any one faced any issue with tomcat 8 adapters.
>For some reason i am not get keycloak login screen on my web app,Here is my
>scenario
>
>1. Latest version of Keycloak runs on wildfly
>2. A war runs on tomcat.I put all the jar files under tomcat/lib dir.Below
>is the keycloak.json and my web.xml file which goes under my WEB-INF
>3. When i login , i directly gets my webapp page and it does not redirects
>me to keycloak login page.
>4. My webapp is build using angularjs
>
>keycloak.json
>********************
>
>{
>
>  "realm": "SnrAppsRealm",
>
>  "realm-public-key":
>"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAutb9hlKhbZvIm6RDPPFFpR1RcNAt/NpzCWemJOveG1Ve5eu2AwPKwmqvkhTaMWUW990BFPIkBRPv13Grt9AVTMTgU10IeK/PM9CGN05eFr6S3KMSSTskpszIN3opiRQ5r8/eCYjC4Bk6qFkbtrlp6ORvUkLS7nMLwVLh9JDo2Fx9nWd+l1oLq1YpYMYeLDcaOAW/vdjYSfyLueu2wESjY9oSEs8x43ZyIhNKGRmW3oDXYL8X5guiqalZD5gbhWv6v3WpeTqdi0sLv4GI2B3oSG76Z/x2On/Sc2r3szfM8kUllyV7K8uYoMgD7DFVOZX5g6Bi6xntzkJHwLMJtW4UPwIDAQAB",
>
>  "auth-server-url": "http://xxxxx.com:9322/auth",
>
>  "ssl-required": "none",
>
>  "resource": "snrapps-web",
>
>  "credentials": {
>
>    "secret": "dda19c87-efee-4c33-a1b3-8b64ad545s0f"
>
>  },
>
>  "use-resource-role-mappings": true
>
>}
>
>*****************************
>
>web.xml
>
><web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="
>http://www.w3.org/2001/XMLSchema-instance"
>
>xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
>
>       <module-name>snrapps-web</module-name>
>
>
>
>    <security-constraint>
>
>        <web-resource-collection>
>
>            <web-resource-name>/snrapps-web</web-resource-name>
>
>            <url-pattern>/*</url-pattern>
>
>        </web-resource-collection>
>
>        <auth-constraint>
>
>            <role-name>user</role-name>
>
>        </auth-constraint>
>
>    </security-constraint>
>
>
>    <security-constraint>
>
>        <web-resource-collection>
>
>        <url-pattern>/*</url-pattern>
>
>        </web-resource-collection>
>
>        <user-data-constraint>
>
>            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
>
>        </user-data-constraint>
>
>    </security-constraint>
>
>    <login-config>
>
>        <auth-method>BASIC</auth-method>
>
>        <realm-name>this is ignored currently</realm-name>
>
>    </login-config>
>
>    <security-role>
>
>        <role-name>admin</role-name>
>
>    </security-role>
>
>    <security-role>
>
>        <role-name>user</role-name>
>
>    </security-role>
>
></web-app>
>
>
>***************
>
>META-INF/context.xml
>
>
><?xml version="1.0" encoding="UTF-8"?>
>
>    <Context path="/snrapps-web">
>
>        <Valve className=
>"org.keycloak.adapters.tomcat.KeycloakAuthenticatorValve" />
>
>    </Context>
>
>
>***********
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20151101/8c65d636/attachment.html 
>
>------------------------------
>
>_______________________________________________
>keycloak-user mailing list
>keycloak-user at lists.jboss.org
>https://lists.jboss.org/mailman/listinfo/keycloak-user
>
>End of keycloak-user Digest, Vol 23, Issue 1
>********************************************



More information about the keycloak-user mailing list