# Create a User federation

**URL:** <https://forum.keycloak.org/t/create-a-user-federation/3271>\
**Category:** Miscellanaeous\
**Created:** [June 11, 2020, 4:14pm UTC](https://forum.keycloak.org/t/create-a-user-federation/3271 "2020-06-11T16:14:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![keycloakhero](https://avatars.discourse-cdn.com/v4/letter/k/0ea827/32.png) [@keycloakhero](https://forum.keycloak.org/u/keycloakhero)\
**Post date:** [June 11, 2020, 4:14pm UTC](https://forum.keycloak.org/t/create-a-user-federation/3271/1 "2020-06-11T16:14:09Z")

</div>

Hello,  
I want to create a new User-federation in Keycloak. I use the example of dasnike: [https://github.com/dasniko/keycloak-user-spi-demo#notification-settings](https://github.com/dasniko/keycloak-user-spi-demo#notification-settings) this works fine.  
But I have the problem, that the programm gets an “java.lang.RuntimeException”, if the user is not found, a null value is passed. how do I tell keycloak that in such a case it should bring an error message to the surface, as if an incorrect password is entered (user not available …).

Greetings
