Well, I resorted to the only option I could at this point and hacked the
code myself.
It's lame, terrible and a hack of a fix, but at least it seems to work.
root@csim-cloud:/var/www/gitorious/lib:(git::master) # git diff
gitorious/authentication/ldap_configurator.rb
diff --git a/lib/gitorious/authentication/ldap_configurator.rb
b/lib/gitorious/authentication/ldap_configurator.rb
index 670af27..7440d8c 100644
--- a/lib/gitorious/authentication/ldap_configurator.rb
+++ b/lib/gitorious/authentication/ldap_configurator.rb
@@ -94,11 +94,12 @@ module Gitorious
end
def self.transform_username(username)
+ username = username.gsub("@hp.com", "")
username.gsub(".","-")
end
def reverse_username_transformation(username)
- username.gsub("-",".")
+ username.gsub("-",".") + "@hp.com"
end
end
end
On Thursday, December 6, 2012 10:08:17 AM UTC-8, Walter Boring wrote:
>
> Still no joy? I'm still not able to use gitorious with this
> configuration. The save! call is still failing due to the login being the
> email address.
>
>
>
> On Tuesday, November 27, 2012 1:34:41 PM UTC-8, Walter Boring wrote:
>>
>> The username creates created from the auto_register method's call to
>>
>> user.login = transform_username(username)
>>
>> That internally calls LDAPConfigurator.transform_username(username)
>>
>> Which is
>> username.gsub(".", "-")
>>
>> Shouldn't the user.login be set via...
>>
>> user.login = build_username(username)
>>
>> instead?
>>
>>
>>
>> On Tuesday, November 27, 2012 1:19:37 PM UTC-8, Walter Boring wrote:
>>>
>>> ok I tried to set the distinguished_name_template as you described, but
>>> it didn't change anything.
>>> The login member in the user object is still set to
>>> "walter-boring@hp-com" prior to calling save! which fails the validation.
>>>
>>> Walt
>>>
>>> On Tuesday, November 20, 2012 7:51:03 AM UTC-8, Ken Dreyer wrote:
>>>>
>>>> On Mon, Nov 19, 2012 at 11:19 AM, Walter Boring <[email protected]>
>>>> wrote:
>>>> > This is the user record just prior to calling user.save
>>>> > #<User id: nil, login: "walter-boring@hp-com", email:
>>>> > "[email protected]", crypted_password: nil, salt: nil, created_at:
>>>> nil,
>>>>
>>>> Unfortunately "@" signs are not currently supported in usernames. You
>>>> should set "hp.com" within the distinguished_name_template in the
>>>> authentication section of gitorious.yml
>>>>
>>>> distinguished_name_template: "{}@hp.com"
>>>>
>>>> So your Gitorious username is just "walter-boring".
>>>>
>>>> That said, I would be happy to test patches to make Gitorious support
>>>> "@" signs in usernames :) Ideally this would allow us to support
>>>> multi-realm authentication.
>>>>
>>>> - Ken
>>>>
>>>
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]