User creation on succesful login

I've written a custom authentication module. When I attempt to log in to a TeamCity I see this message.

Authenticated successfully, but failed to create new user since creating new users by login is not allowed

How can I make it happen?
I've seen in the ldap-ntlm.xml preset file the following:

    <auth-module type="HTTP-NTLM">
      <property key="allowCreatingNewUsersByLogin">false</property>

Is that available in all the modules? Do I need to do some work on the HttpAuthenticationScheme interface?
Thanks for your help, Greg

Comment actions Permalink

Anyone any ideas?

Comment actions Permalink

I managed to move things forward a bit.

In my login module I do implement method:

    public boolean login() throws LoginException {

In there I have this code:

mySubject.getPrincipals().add(new ServerPrincipal(null, user.getName(), null, true, newUserProperties));

Fourth parameter indicates that the user should be created on login.
It works, however I can't make it pass the properties that would populate Name and Email of the user.

I tried these and it doesn't work.

        newUserProperties.put(new SimplePropertyKey("name"), user.getDisplayName());         newUserProperties.put(new SimplePropertyKey("email"), user.getEmailAddress());         newUserProperties.put(new SimplePropertyKey("Name"), user.getDisplayName());         newUserProperties.put(new SimplePropertyKey("Email"), user.getEmailAddress());

What should be those properties?



Please sign in to leave a comment.