<div dir="ltr">Hi,<div><br></div><div>I am trying to set up the demo as per the youtube videos (#1 and #2). I am using keycloak 1.0.5. I have set up per the video (i think), however things aren&#39;t working as expected.</div><div><br></div><div>I browse to <a href="http://localhost:8080/customer-portal/">http://localhost:8080/customer-portal/</a> and all is fine. I click Customer Listing and I am redirected to login page as expected. I enter my name/pw , this is successful and then I am redirected back to <a href="http://localhost:8080/customer-portal/customers/view.jsp">http://localhost:8080/customer-portal/customers/view.jsp</a> but the page is &#39;Forbidden&#39; (redirect uri appears ok here?)</div><div><br></div><div>I am using the &#39;full&#39; version with bundled wildfly server.</div><div><br></div><div><br></div><div><div><br></div><div><b>customer app:</b></div><div>keycloak file</div><div><br></div><div><div>{</div><div>&quot;realm&quot;: &quot;cryo198&quot;,</div><div>&quot;realm-public-key&quot;: &quot;MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCFnsEHg1o9UMBpMoHqLxYesXgDsTHnv1vF0AgrznxAcLfmYUdjvBNdIXZNfB7I7tG9OMHvX21h9arHdcdg2qqk9adLjHuImg/LhYHVOrosJ/sybohrR/Im+k1fTsw/5p/nwZKOF1DLL4/4SZAY2h19FGCi0ZgIvE80psq98UvCNQIDAQAB&quot;,</div><div>&quot;auth-server-url&quot;: &quot;<a href="http://localhost:8080/auth">http://localhost:8080/auth</a>&quot;,</div><div>&quot;ssl-required&quot;: &quot;external&quot;,</div><div>&quot;resource&quot;: &quot;customer-portal&quot;,</div><div>&quot;credentials&quot;: {</div><div>&quot;secret&quot;: &quot;a0872aa0-113d-435c-a9d6-56cd9b270e22&quot;</div><div>}</div><div>}</div></div><div><br></div><div><div><b>web.xml</b></div><div>    &lt;login-config&gt;</div><div>        &lt;auth-method&gt;KEYCLOAK&lt;/auth-method&gt;</div><div>        &lt;realm-name&gt;cryo198&lt;/realm-name&gt;</div><div>    &lt;/login-config&gt;</div></div><div><br></div><div><b>redirect URI:</b></div><div>/customer-portal/*</div><div><br></div><div><b>database app:</b></div><div><div>{</div><div>    &quot;realm&quot;: &quot;cryo198&quot;,</div><div>    &quot;realm-public-key&quot;: &quot;MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCFnsEHg1o9UMBpMoHqLxYesXgDsTHnv1vF0AgrznxAcLfmYUdjvBNdIXZNfB7I7tG9OMHvX21h9arHdcdg2qqk9adLjHuImg/LhYHVOrosJ/sybohrR/Im+k1fTsw/5p/nwZKOF1DLL4/4SZAY2h19FGCi0ZgIvE80psq98UvCNQIDAQAB&quot;,</div><div>    &quot;auth-server-url&quot;: &quot;<a href="http://localhost:8080/auth">http://localhost:8080/auth</a>&quot;,</div><div>    &quot;ssl-required&quot;: &quot;NONE&quot;,</div><div>    &quot;resource&quot;: &quot;database&quot;,</div><div>    &quot;bearer-only&quot;: &quot;true&quot;</div><div>}</div></div><div><br></div><div><div><br></div><div><br></div><div><b>web.xml</b></div><div>    &lt;login-config&gt;</div><div>        &lt;auth-method&gt;KEYCLOAK&lt;/auth-method&gt;</div><div>        &lt;realm-name&gt;cryo198&lt;/realm-name&gt;</div><div>    &lt;/login-config&gt;</div></div><div><br></div><div><div><b>redirect URI:</b></div><div>n./a ..set as bearer only</div></div><div><br></div><div><b>deployed apps:</b></div><div><div>$ /c/tools/keycloak-appliance-dist-all-1.0.5.Final/keycloak-appliance-dist-all-1.0.5.Final/keycloak/bin/jboss-cli.sh -c --command=&quot;deploy -l&quot;</div><div>NAME                   RUNTIME-NAME           ENABLED STATUS</div><div>admin-access.war       admin-access.war       true    OK</div><div>angular-product.war    angular-product.war    true    OK</div><div>auth-server.war        auth-server.war        true    OK</div><div>customer-portal-js.war customer-portal-js.war true    OK</div><div>customer-portal.war    customer-portal.war    true    OK</div><div>database.war           database.war           true    OK</div><div>product-portal.war     product-portal.war     true    OK</div></div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><b>Log:</b></div><div><div>2015-02-13 21:22:29,665 DEBUG [org.keycloak.adapters.PreAuthActionsHandler] (default task-41) adminRequest <a href="http://localhost:8080/customer-portal/custo">http://localhost:8080/customer-portal/custo</a></div><div>mers/view.jsp</div><div>2015-02-13 21:22:29,667 TRACE [org.keycloak.adapters.RequestAuthenticator] (default task-41) --&gt; authenticate()</div><div>2015-02-13 21:22:29,668 TRACE [org.keycloak.adapters.RequestAuthenticator] (default task-41) try bearer</div><div>2015-02-13 21:22:29,669 TRACE [org.keycloak.adapters.RequestAuthenticator] (default task-41) try oauth</div><div>2015-02-13 21:22:29,669 DEBUG [org.keycloak.adapters.RequestAuthenticator] (default task-41) session was null, returning null</div><div>2015-02-13 21:22:29,670 DEBUG [org.keycloak.adapters.OAuthRequestAuthenticator] (default task-41) there was no code</div><div>2015-02-13 21:22:29,670 DEBUG [org.keycloak.adapters.OAuthRequestAuthenticator] (default task-41) redirecting to auth server</div><div>2015-02-13 21:22:29,671 DEBUG [org.keycloak.adapters.OAuthRequestAuthenticator] (default task-41) callback uri: <a href="http://localhost:8080/customer-portal/">http://localhost:8080/customer-portal/</a></div><div>customers/view.jsp</div><div>2015-02-13 21:22:29,672 DEBUG [org.keycloak.adapters.OAuthRequestAuthenticator] (default task-41) Sending redirect to login page: <a href="http://localhost:808">http://localhost:808</a></div><div>0/auth/realms/cryo198/tokens/login?client_id=customer-portal&amp;redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fcustomer-portal%2Fcustomers%2Fview.jsp&amp;state</div><div>=2%2F8185a8ea-5a38-4a91-b990-1b32ccabb2e8&amp;login=true</div><div>2015-02-13 21:22:29,701 DEBUG [org.keycloak.services.resources.TokenService] (default task-42) replacing relative valid redirect with: <a href="http://localhos">http://localhos</a></div><div>t:8080/customer-portal/*</div><div>2015-02-13 21:22:29,702 DEBUG [org.keycloak.services.managers.AuthenticationManager] (default task-42) Could not find cookie: KEYCLOAK_IDENTITY</div><div>2015-02-13 21:22:46,300 DEBUG [org.keycloak.services.resources.TokenService] (default task-43) replacing relative valid redirect with: <a href="http://localhos">http://localhos</a></div><div>t:8080/customer-portal/*</div><div>2015-02-13 21:22:46,301 DEBUG [org.keycloak.services.managers.AuthenticationManager] (default task-43) validating password for user: walt</div><div>2015-02-13 21:22:46,306 DEBUG [org.keycloak.services.managers.AuthenticationManager] (default task-43) Expiring remember me cookie</div><div>2015-02-13 21:22:46,307 DEBUG [org.keycloak.services.managers.AuthenticationManager] (default task-43) Expiring cookie: KEYCLOAK_REMEMBER_ME path: /au</div><div>th/realms/cryo198</div><div>2015-02-13 21:22:46,308 DEBUG [org.keycloak.services.resources.flows.OAuthFlows] (default task-43) processAccessCode: isResource: true</div><div>2015-02-13 21:22:46,308 DEBUG [org.keycloak.services.resources.flows.OAuthFlows] (default task-43) processAccessCode: go to oauth page?: false</div><div>2015-02-13 21:22:46,329 DEBUG [org.keycloak.services.resources.flows.OAuthFlows] (default task-43) redirectAccessCode: state: 2/8185a8ea-5a38-4a91-b99</div><div>0-1b32ccabb2e8</div><div>2015-02-13 21:22:46,340 DEBUG [org.keycloak.services.managers.AuthenticationManager] (default task-43) Create login cookie - name: KEYCLOAK_IDENTITY,</div><div>path: /auth/realms/cryo198, max-age: -1</div><div>2015-02-13 21:22:46,387 DEBUG [org.keycloak.adapters.PreAuthActionsHandler] (default task-44) adminRequest <a href="http://localhost:8080/customer-portal/custo">http://localhost:8080/customer-portal/custo</a></div><div>mers/view.jsp?code=zf9VUvG6-QkAWtF8xDFcJfnBnrY.OTY1YjllMzMtZDdlNS00YWQwLWEwMzgtZjIzMTJhODZjMTIx&amp;state=2%2F8185a8ea-5a38-4a91-b990-1b32ccabb2e8</div><div>2015-02-13 21:22:46,388 TRACE [org.keycloak.adapters.RequestAuthenticator] (default task-44) --&gt; authenticate()</div><div>2015-02-13 21:22:46,389 TRACE [org.keycloak.adapters.RequestAuthenticator] (default task-44) try bearer</div><div>2015-02-13 21:22:46,389 TRACE [org.keycloak.adapters.RequestAuthenticator] (default task-44) try oauth</div><div>2015-02-13 21:22:46,389 DEBUG [org.keycloak.adapters.RequestAuthenticator] (default task-44) session was null, returning null</div><div>2015-02-13 21:22:46,390 DEBUG [org.keycloak.adapters.OAuthRequestAuthenticator] (default task-44) there was a code, resolving</div><div>2015-02-13 21:22:46,390 DEBUG [org.keycloak.adapters.OAuthRequestAuthenticator] (default task-44) checking state cookie for after code</div><div>2015-02-13 21:22:46,390 DEBUG [org.keycloak.adapters.OAuthRequestAuthenticator] (default task-44) ** reseting application state cookie</div><div>2015-02-13 21:22:46,477 DEBUG [org.keycloak.adapters.OAuthRequestAuthenticator] (default task-44) Token Verification succeeded!</div><div>2015-02-13 21:22:46,478 DEBUG [org.keycloak.adapters.OAuthRequestAuthenticator] (default task-44) successful authenticated</div><div>2015-02-13 21:22:46,478 TRACE [org.keycloak.adapters.RefreshableKeycloakSecurityContext] (default task-44) checking whether to refresh.</div><div>2015-02-13 21:22:46,478 TRACE [org.keycloak.adapters.undertow.KeycloakUndertowAccount] (default task-44) use realm role mappings</div><div>2015-02-13 21:22:46,479 DEBUG [org.keycloak.adapters.wildfly.WildflyRequestAuthenticator] (default task-44) propagate security context to wildfly</div><div>2015-02-13 21:22:46,481 TRACE [org.keycloak.adapters.RefreshableKeycloakSecurityContext] (default task-44) checking whether to refresh.</div><div>2015-02-13 21:22:46,484 DEBUG [org.keycloak.adapters.RequestAuthenticator] (default task-44) AUTHENTICATED</div><div>2015-02-13 21:22:46,502 DEBUG [org.keycloak.adapters.PreAuthActionsHandler] (default task-46) adminRequest <a href="http://localhost:8080/customer-portal/custo">http://localhost:8080/customer-portal/custo</a></div><div>mers/view.jsp</div><div>2015-02-13 21:22:46,505 TRACE [org.keycloak.adapters.RequestAuthenticator] (default task-46) --&gt; authenticate()</div><div>2015-02-13 21:22:46,506 TRACE [org.keycloak.adapters.RequestAuthenticator] (default task-46) try bearer</div><div>2015-02-13 21:22:46,506 TRACE [org.keycloak.adapters.RequestAuthenticator] (default task-46) try oauth</div><div>2015-02-13 21:22:46,507 DEBUG [org.keycloak.adapters.undertow.KeycloakUndertowAccount] (default task-46) session is active</div><div>2015-02-13 21:22:46,508 DEBUG [org.keycloak.adapters.RequestAuthenticator] (default task-46) Cached account found</div><div>2015-02-13 21:22:46,508 DEBUG [org.keycloak.adapters.wildfly.WildflyRequestAuthenticator] (default task-46) propagate security context to wildfly</div><div>2015-02-13 21:22:46,509 DEBUG [org.keycloak.adapters.RequestAuthenticator] (default task-46) AUTHENTICATED: was cached</div><div>2015-02-13 21:22:46,510 DEBUG [org.keycloak.adapters.AuthenticatedActionsHandler] (default task-46) AuthenticatedActionsValve.invoke <a href="http://localhost">http://localhost</a>:</div><div>8080/customer-portal/customers/view.jsp</div></div><div><br></div><div><br></div><div>Many thanks</div><div>W</div><div><br></div><div style><div style="font-weight:bold"><br></div></div></div>