Hi Sebastien,
I figured out how to accomplish what you described using the
getDatasetById() method, however, I think there is a problem with how LSC
is getting the data that it is populating into the bean which is
corrupting it.
Here is a sample of the source data:
01 05 00 00 00 00 00 05 15 00 00 00 ab 2b e9 90 ........ .....+..
47 88 dc 84 56 b5 cd 20 88 97 05 00 G...V... ....
LENGTH: 28
Here are my results using the following relevant code:
var
s=java.lang.String(srcBean.getDatasetById("objectSid").iterator().next()).getBytes("US-ASCII");
Then reading the value using:
s[i].toString(16)
String.fromCharCode(s[i])
Outputs:
01 05 00 00 00 00 00 05 15 00 00 00 3f 2b 3f 47 ........ ....?+?G
3f 3f 56 3f 3f 20 3f 3f 05 00 ??V??.?? ..
LENGTH: 26
This is close, but not quite the right data.
getDatasetFirstValueById("objectSid") returns the following:
01 05 00 00 00 00 00 05 15 00 00 00 ef bf bd 2b ........ .......+
ef bf bd 47 ef bf bd dc 84 56 ef bf bd ef bf bd ...G.... .V......
20 ef bf bd ef bf bd 05 00 ........ .
If I use
java.lang.String(getDatasetFirstValueById()).getBytes("US-ASCII"), then it
returns the exact same result as reading the value via getDatasetById().
Any idea what is going on here? Other things to try?
Thanks,
Alex
> Hi Alex,
>
> You should take a look at the following Javadoc page :
> http://lsc-project.org/javadoc/2.0-SNAPSHOT/org/lsc/beans/IBean.html
>
> You will see that there is a method
> (Set<http://download.oracle.com/javase/6/docs/api/java/util/Set.html?is-external=true>
> <Object<http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true>>
> *getDatasetById*(String<http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true>
> id))
> that you can use to iterate over the results to cast them to a byte array
> that you should be able to use.
>
> Kind regards,
> --
> Sebastien BAHLOUL
> IAM / Security specialist
> Ldap Synchronization Connector : http://lsc-project.org
> Blog : http://sbahloul.wordpress.com/
>
>
>
> 2012/8/7 <[email protected]>
>
>>
>> Hello,
>>
>> I need to extract the RID from the AD objectSid, and use it to populate
>> uidNumber in the destination LDAP. All methods I could find in the LSC
>> documentation seem to corrupt the byte value, preventing parsing of the
>> objectSid. Most methods return a string, which seems to corrupt the data
>> during string conversion. The only method which returns a byte array
>> (getDatasetsBytes) seems to return a small amount of unusable random
>> data
>> every time (couldn't find any useful documentation on this one). It
>> seems
>> like LSC needs a method like getDatasetBytesById() that returns an
>> unadulterated byte array for the attribute in question. Is there
>> presently a method for accomplishing this which I may have missed?
>>
>> Additional Info:
>> - LSC 2.0
>> - I've set <binaryAttribute><string>objectSid</string></binaryAttribute>
>> in the LDAP source to no avail
>>
>> Thanks!
>> Alex
>>
>>
>> _______________________________________________________________
>> Ldap Synchronization Connector (LSC) - http://lsc-project.org
>>
>> lsc-users mailing list
>> [email protected]
>> http://lists.lsc-project.org/listinfo/lsc-users
>>
>
> Hi Alex,
>
> You should take a look at the following Javadoc page :
> http://lsc-project.org/javadoc/2.0-SNAPSHOT/org/lsc/beans/IBean.html
>
> You will see that there is a method
> (Set<http://download.oracle.com/javase/6/docs/api/java/util/Set.html?is-external=true>
> <Object<http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true>>
> *getDatasetById*(String<http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true>
> id))
> that you can use to iterate over the results to cast them to a byte array
> that you should be able to use.
>
> Kind regards,
> --
> Sebastien BAHLOUL
> IAM / Security specialist
> Ldap Synchronization Connector : http://lsc-project.org
> Blog : http://sbahloul.wordpress.com/
>
>
>
> 2012/8/7 <[email protected]>
>
>>
>> Hello,
>>
>> I need to extract the RID from the AD objectSid, and use it to populate
>> uidNumber in the destination LDAP. All methods I could find in the LSC
>> documentation seem to corrupt the byte value, preventing parsing of the
>> objectSid. Most methods return a string, which seems to corrupt the data
>> during string conversion. The only method which returns a byte array
>> (getDatasetsBytes) seems to return a small amount of unusable random
>> data
>> every time (couldn't find any useful documentation on this one). It
>> seems
>> like LSC needs a method like getDatasetBytesById() that returns an
>> unadulterated byte array for the attribute in question. Is there
>> presently a method for accomplishing this which I may have missed?
>>
>> Additional Info:
>> - LSC 2.0
>> - I've set <binaryAttribute><string>objectSid</string></binaryAttribute>
>> in the LDAP source to no avail
>>
>> Thanks!
>> Alex
>>
>>
>> _______________________________________________________________
>> Ldap Synchronization Connector (LSC) - http://lsc-project.org
>>
>> lsc-users mailing list
>> [email protected]
>> http://lists.lsc-project.org/listinfo/lsc-users
>>
>
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users