Hello
It looks like you're triying to achieve a 2-step process.
1. Authenticate as Roomnumber + Lastname
2. If authenticated - allow self-registration
Well - why not just authenticate against roomnumber + lastname? You should be able to do that using roomnumber as username and lastname as password...
In your filter add a result with name like "Lastname", Alias name "User_Password" and it should work as normal username/password authentication.