# IDP initiated login

**URL:** <https://forum.keycloak.org/t/idp-initiated-login/954>\
**Category:** Getting advice\
**Created:** [January 15, 2020, 7:54am UTC](https://forum.keycloak.org/t/idp-initiated-login/954 "2020-01-15T07:54:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkomulai](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jkomulai](https://forum.keycloak.org/u/jkomulai)\
**Post date:** [January 15, 2020, 7:54am UTC](https://forum.keycloak.org/t/idp-initiated-login/954/1 "2020-01-15T07:54:36Z")

</div>

Hi, I’m strugling with Keycloak “IDP initiated login” feature. I have application which context-root is /XYZ and servlet is mapped to url /XYZ/sso. I’m using Wildfly and Keycloak adapter is configured using Keycloak SAML subsystem. IDP initiated login works fine until it jumps to my app. After login it jumps to /ZYX/sso/saml and after that it redirects to /XYZ. This point it fails because that’s not right url for app servlet. It should redirect to /XYZ/sso. I tried to define relayState with value /XYZ/sso but no luck. I can see that relayState is passed to my app but it has no effect. Keycloak adapter doesn’t care about it and it always redirects to /XYZ, which is application context-root.

Thanks  
Jarno
