Re: [Dev] [IS][Greg] Configuring LDAP User Store in IS 5.0.0 and Greg 5.1.0

2015-11-30 Thread Chamalee De Silva
Hi Damith,

Attached here are the user-mgt.xml files of Greg and IS respectively.


Thanks,
Chamalee


On Mon, Nov 30, 2015 at 3:16 PM, Damith Senanayake  wrote:

> Hi Chamalee,
>
> It could be that the password digest method is different when creating the
> user and later when configuring the user store manager. Could you please
> attach the user-mgt.xml?
>
> On Mon, Nov 30, 2015 at 1:40 PM, Chamalee De Silva 
> wrote:
>
>> + Darshana, Damith
>>
>> On Mon, Nov 30, 2015 at 1:37 PM, Chamalee De Silva 
>> wrote:
>>
>>> Hi devs,
>>>
>>> I have created a *read-write LDAP user store* as per [1] and there I
>>> have used *admin, admin* as credentials. I could successfully create it
>>> and start the server.
>>>
>>> Then I created a user with the following credentials.
>>>
>>> username : adminSOA
>>> password : 123456
>>> role : admin (default admin role)
>>>
>>> Then I followed [2] and configured a read-only (not read-write) external
>>> user store in Greg 5.1.0
>>>
>>> Given the user credentials as per the created user as above.
>>>
>>>
>>> The configuration is as follows in user-mgt.xml in Greg.
>>>
>>> **
>>> * true*
>>> *admin*
>>> **
>>> * adminSOA*
>>> * 123456*
>>> **
>>> *everyone *
>>> *jdbc/WSO2USER_DB*
>>> **
>>>
>>> *-*
>>>
>>> * uid=adminSOA,ou=system
>>>   123456   *
>>>
>>> But when I start Greg it gives the following error.
>>>
>>> [2015-11-30 13:13:36,823] ERROR
>>> {org.wso2.carbon.user.core.ldap.LDAPConnectionContext} -  Error obtaining
>>> connection. [LDAP: error code 49 - cannot bind the principalDn.]
>>> javax.naming.AuthenticationException: [LDAP: error code 49 - cannot bind
>>> the principalDn.]
>>> at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3087)
>>> at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3033)
>>> at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2835)
>>> at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2749)
>>> at com.sun.jndi.ldap.LdapCtx.(LdapCtx.java:316)
>>> at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:193)
>>> at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:211)
>>> at
>>> com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
>>> at
>>> com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
>>> at
>>> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
>>> at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
>>> at javax.naming.InitialContext.init(InitialContext.java:242)
>>> at javax.naming.InitialContext.(InitialContext.java:216)
>>> at
>>> javax.naming.directory.InitialDirContext.(InitialDirContext.java:101)
>>> at
>>> org.wso2.carbon.user.core.ldap.LDAPConnectionContext.getContext(LDAPConnectionContext.java:167)
>>> at
>>> org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:156)
>>> at
>>> org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:100)
>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>>> at
>>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
>>> at
>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
>>> at
>>> org.wso2.carbon.user.core.common.DefaultRealm.createObjectWithOptions(DefaultRealm.java:336)
>>> at
>>> org.wso2.carbon.user.core.common.DefaultRealm.initializeObjects(DefaultRealm.java:203)
>>> at
>>> org.wso2.carbon.user.core.common.DefaultRealm.init(DefaultRealm.java:108)
>>> at
>>> org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:230)
>>> at
>>> org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:96)
>>> at
>>> org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:109)
>>> at
>>> org.wso2.carbon.user.core.internal.Activator.startDeploy(Activator.java:68)
>>> at
>>> org.wso2.carbon.user.core.internal.BundleCheckActivator.start(BundleCheckActivator.java:61)
>>> at
>>> org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at
>>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>>> at
>>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>>> at
>>> org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>>> at
>>> org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
>>> at
>>> 

Re: [Dev] [IS][Greg] Configuring LDAP User Store in IS 5.0.0 and Greg 5.1.0

2015-11-30 Thread Damith Senanayake
Yes that is the issue. In the user-mgt-xml-of GREG, the password digest is
configured as PLAIN_TEXT while in the other it is configured as SHA. They
need to be the same.

Hope this helps.

Thanks

On Mon, Nov 30, 2015 at 3:24 PM, Chamalee De Silva 
wrote:

> Hi Damith,
>
> Attached here are the user-mgt.xml files of Greg and IS respectively.
>
>
> Thanks,
> Chamalee
>
>
> On Mon, Nov 30, 2015 at 3:16 PM, Damith Senanayake 
> wrote:
>
>> Hi Chamalee,
>>
>> It could be that the password digest method is different when creating
>> the user and later when configuring the user store manager. Could you
>> please attach the user-mgt.xml?
>>
>> On Mon, Nov 30, 2015 at 1:40 PM, Chamalee De Silva 
>> wrote:
>>
>>> + Darshana, Damith
>>>
>>> On Mon, Nov 30, 2015 at 1:37 PM, Chamalee De Silva 
>>> wrote:
>>>
 Hi devs,

 I have created a *read-write LDAP user store* as per [1] and there I
 have used *admin, admin* as credentials. I could successfully create
 it and start the server.

 Then I created a user with the following credentials.

 username : adminSOA
 password : 123456
 role : admin (default admin role)

 Then I followed [2] and configured a read-only (not read-write)
 external user store in Greg 5.1.0

 Given the user credentials as per the created user as above.


 The configuration is as follows in user-mgt.xml in Greg.

 **
 * true*
 *admin*
 **
 * adminSOA*
 * 123456*
 **
 *everyone *
 *jdbc/WSO2USER_DB*
 **

 *-*

 * uid=adminSOA,ou=system
 123456   *

 But when I start Greg it gives the following error.

 [2015-11-30 13:13:36,823] ERROR
 {org.wso2.carbon.user.core.ldap.LDAPConnectionContext} -  Error obtaining
 connection. [LDAP: error code 49 - cannot bind the principalDn.]
 javax.naming.AuthenticationException: [LDAP: error code 49 - cannot
 bind the principalDn.]
 at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3087)
 at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3033)
 at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2835)
 at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2749)
 at com.sun.jndi.ldap.LdapCtx.(LdapCtx.java:316)
 at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:193)
 at
 com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:211)
 at
 com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
 at
 com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
 at
 javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
 at
 javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
 at javax.naming.InitialContext.init(InitialContext.java:242)
 at javax.naming.InitialContext.(InitialContext.java:216)
 at
 javax.naming.directory.InitialDirContext.(InitialDirContext.java:101)
 at
 org.wso2.carbon.user.core.ldap.LDAPConnectionContext.getContext(LDAPConnectionContext.java:167)
 at
 org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:156)
 at
 org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:100)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
 at
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
 at
 org.wso2.carbon.user.core.common.DefaultRealm.createObjectWithOptions(DefaultRealm.java:336)
 at
 org.wso2.carbon.user.core.common.DefaultRealm.initializeObjects(DefaultRealm.java:203)
 at
 org.wso2.carbon.user.core.common.DefaultRealm.init(DefaultRealm.java:108)
 at
 org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:230)
 at
 org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:96)
 at
 org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:109)
 at
 org.wso2.carbon.user.core.internal.Activator.startDeploy(Activator.java:68)
 at
 org.wso2.carbon.user.core.internal.BundleCheckActivator.start(BundleCheckActivator.java:61)
 at
 org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
 at java.security.AccessController.doPrivileged(Native Method)
 at
 

Re: [Dev] [IS][Greg] Configuring LDAP User Store in IS 5.0.0 and Greg 5.1.0

2015-11-30 Thread Damith Senanayake
Is it the same stacktrace or something different, if you don't mind, could
you please attach the new stacktrace.

If it is the same error it could be that the user you are trying to bind
does not exist. For this, you have to take a look at the following
property.

If you are trying to connect to the ldap user store of the IS instance you
are running, you will have to change the port according to the offset you
have set for it instead of using the standard property value.

ldap://localhost:${Ports.EmbeddedLDAP.LDAPServerPort}
uid=admin,ou=system
admin

The value in red indicates that what you are binding is the instance
of the GREG (since this was taken from the greg-user-mgt.xml).
Instead, if you are using the IS with an offset (say 1 ) you should
set the ConnectionURL as :

ldap://localhost:1390

Since we use 10389 as the standard ldap server port for the embedded ldap.


Also, if you are trying to set the user you created in IS as your
super admin in GREG, you should make sure the following is satisfied.


1. The GREG user store is pointed to the LDAP of the IS (not the
embedded one of the GREG but the embedded one of the IS)

2. The password digest you use in GREG user-mgt.xml is the same when
you created the user in IS. In this particular case, I suggest that it
will be SHA and not PLAIN_TEXT.

3. The connection name and password are correct. i.e. the
Distinguished Name of the connection should be a valid existing one
and the password should be correct. In your case, uid=admin, ou=system
is correct. However, if you want to bind to the user you created
yourself, it should change to uid=adminSOA, ou=Users, dc=wso2,dc=org.



On Mon, Nov 30, 2015 at 7:47 PM, Chamalee De Silva 
wrote:

> Hi Damith,
> Still I get the same error.
>  [LDAP: error code 49 - cannot bind the principalDn.]
> Is there any other cause for this exception ?
>
>
>
> Thanks
>
> On Mon, Nov 30, 2015 at 3:27 PM, Damith Senanayake 
> wrote:
>
>> Yes that is the issue. In the user-mgt-xml-of GREG, the password digest
>> is configured as PLAIN_TEXT while in the other it is configured as SHA.
>> They need to be the same.
>>
>> Hope this helps.
>>
>> Thanks
>>
>> On Mon, Nov 30, 2015 at 3:24 PM, Chamalee De Silva 
>> wrote:
>>
>>> Hi Damith,
>>>
>>> Attached here are the user-mgt.xml files of Greg and IS respectively.
>>>
>>>
>>> Thanks,
>>> Chamalee
>>>
>>>
>>> On Mon, Nov 30, 2015 at 3:16 PM, Damith Senanayake 
>>> wrote:
>>>
 Hi Chamalee,

 It could be that the password digest method is different when creating
 the user and later when configuring the user store manager. Could you
 please attach the user-mgt.xml?

 On Mon, Nov 30, 2015 at 1:40 PM, Chamalee De Silva 
 wrote:

> + Darshana, Damith
>
> On Mon, Nov 30, 2015 at 1:37 PM, Chamalee De Silva 
> wrote:
>
>> Hi devs,
>>
>> I have created a *read-write LDAP user store* as per [1] and there I
>> have used *admin, admin* as credentials. I could successfully create
>> it and start the server.
>>
>> Then I created a user with the following credentials.
>>
>> username : adminSOA
>> password : 123456
>> role : admin (default admin role)
>>
>> Then I followed [2] and configured a read-only (not read-write)
>> external user store in Greg 5.1.0
>>
>> Given the user credentials as per the created user as above.
>>
>>
>> The configuration is as follows in user-mgt.xml in Greg.
>>
>> **
>> * true*
>> *admin*
>> **
>> * adminSOA*
>> * 123456*
>> **
>> *everyone *
>> *jdbc/WSO2USER_DB*
>> **
>>
>> *-*
>>
>> * uid=adminSOA,ou=system
>>   123456  
>>  *
>>
>> But when I start Greg it gives the following error.
>>
>> [2015-11-30 13:13:36,823] ERROR
>> {org.wso2.carbon.user.core.ldap.LDAPConnectionContext} -  Error obtaining
>> connection. [LDAP: error code 49 - cannot bind the principalDn.]
>> javax.naming.AuthenticationException: [LDAP: error code 49 - cannot
>> bind the principalDn.]
>> at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3087)
>> at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3033)
>> at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2835)
>> at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2749)
>> at com.sun.jndi.ldap.LdapCtx.(LdapCtx.java:316)
>> at
>> com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:193)
>> at
>> com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:211)
>> at
>> 

Re: [Dev] [IS][Greg] Configuring LDAP User Store in IS 5.0.0 and Greg 5.1.0

2015-11-30 Thread Chamalee De Silva
Hi Damith,

Changing the connection name form *uid=adminSOA, ou=system* to *uid=adminSOA,
ou=Users, dc=wso2,dc=org* solved the issue.

Thanks for the help.




Thanks,
Chamalee.









On Tue, Dec 1, 2015 at 9:07 AM, Damith Senanayake  wrote:

> Is it the same stacktrace or something different, if you don't mind, could
> you please attach the new stacktrace.
>
> If it is the same error it could be that the user you are trying to bind
> does not exist. For this, you have to take a look at the following
> property.
>
> If you are trying to connect to the ldap user store of the IS instance you
> are running, you will have to change the port according to the offset you
> have set for it instead of using the standard property value.
>
>  name="ConnectionURL">ldap://localhost:${Ports.EmbeddedLDAP.LDAPServerPort}
> uid=admin,ou=system
> admin
>
> The value in red indicates that what you are binding is the instance of the 
> GREG (since this was taken from the greg-user-mgt.xml). Instead, if you are 
> using the IS with an offset (say 1 ) you should set the ConnectionURL as :
>
> ldap://localhost:1390
>
> Since we use 10389 as the standard ldap server port for the embedded ldap.
>
>
> Also, if you are trying to set the user you created in IS as your super admin 
> in GREG, you should make sure the following is satisfied.
>
>
> 1. The GREG user store is pointed to the LDAP of the IS (not the embedded one 
> of the GREG but the embedded one of the IS)
>
> 2. The password digest you use in GREG user-mgt.xml is the same when you 
> created the user in IS. In this particular case, I suggest that it will be 
> SHA and not PLAIN_TEXT.
>
> 3. The connection name and password are correct. i.e. the Distinguished Name 
> of the connection should be a valid existing one and the password should be 
> correct. In your case, uid=admin, ou=system is correct. However, if you want 
> to bind to the user you created yourself, it should change to uid=adminSOA, 
> ou=Users, dc=wso2,dc=org.
>
>
>
> On Mon, Nov 30, 2015 at 7:47 PM, Chamalee De Silva 
> wrote:
>
>> Hi Damith,
>> Still I get the same error.
>>  [LDAP: error code 49 - cannot bind the principalDn.]
>> Is there any other cause for this exception ?
>>
>>
>>
>> Thanks
>>
>> On Mon, Nov 30, 2015 at 3:27 PM, Damith Senanayake 
>> wrote:
>>
>>> Yes that is the issue. In the user-mgt-xml-of GREG, the password digest
>>> is configured as PLAIN_TEXT while in the other it is configured as SHA.
>>> They need to be the same.
>>>
>>> Hope this helps.
>>>
>>> Thanks
>>>
>>> On Mon, Nov 30, 2015 at 3:24 PM, Chamalee De Silva 
>>> wrote:
>>>
 Hi Damith,

 Attached here are the user-mgt.xml files of Greg and IS respectively.


 Thanks,
 Chamalee


 On Mon, Nov 30, 2015 at 3:16 PM, Damith Senanayake 
 wrote:

> Hi Chamalee,
>
> It could be that the password digest method is different when creating
> the user and later when configuring the user store manager. Could you
> please attach the user-mgt.xml?
>
> On Mon, Nov 30, 2015 at 1:40 PM, Chamalee De Silva 
> wrote:
>
>> + Darshana, Damith
>>
>> On Mon, Nov 30, 2015 at 1:37 PM, Chamalee De Silva > > wrote:
>>
>>> Hi devs,
>>>
>>> I have created a *read-write LDAP user store* as per [1] and there
>>> I have used *admin, admin* as credentials. I could successfully
>>> create it and start the server.
>>>
>>> Then I created a user with the following credentials.
>>>
>>> username : adminSOA
>>> password : 123456
>>> role : admin (default admin role)
>>>
>>> Then I followed [2] and configured a read-only (not read-write)
>>> external user store in Greg 5.1.0
>>>
>>> Given the user credentials as per the created user as above.
>>>
>>>
>>> The configuration is as follows in user-mgt.xml in Greg.
>>>
>>> **
>>> * true*
>>> *admin*
>>> **
>>> * adminSOA*
>>> * 123456*
>>> **
>>> *everyone *
>>> *jdbc/WSO2USER_DB*
>>> **
>>>
>>> *-*
>>>
>>> * uid=adminSOA,ou=system
>>>   123456 
>>>   *
>>>
>>> But when I start Greg it gives the following error.
>>>
>>> [2015-11-30 13:13:36,823] ERROR
>>> {org.wso2.carbon.user.core.ldap.LDAPConnectionContext} -  Error 
>>> obtaining
>>> connection. [LDAP: error code 49 - cannot bind the principalDn.]
>>> javax.naming.AuthenticationException: [LDAP: error code 49 - cannot
>>> bind the principalDn.]
>>> at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3087)
>>> at 

[Dev] [IS][Greg] Configuring LDAP User Store in IS 5.0.0 and Greg 5.1.0

2015-11-30 Thread Chamalee De Silva
Hi devs,

I have created a *read-write LDAP user store* as per [1] and there I have
used *admin, admin* as credentials. I could successfully create it and
start the server.

Then I created a user with the following credentials.

username : adminSOA
password : 123456
role : admin (default admin role)

Then I followed [2] and configured a read-only (not read-write) external
user store in Greg 5.1.0

Given the user credentials as per the created user as above.


The configuration is as follows in user-mgt.xml in Greg.

**
* true*
*admin*
**
* adminSOA*
* 123456*
**
*everyone *
*jdbc/WSO2USER_DB*
**

*-*

* uid=adminSOA,ou=system
123456   *

But when I start Greg it gives the following error.

[2015-11-30 13:13:36,823] ERROR
{org.wso2.carbon.user.core.ldap.LDAPConnectionContext} -  Error obtaining
connection. [LDAP: error code 49 - cannot bind the principalDn.]
javax.naming.AuthenticationException: [LDAP: error code 49 - cannot bind
the principalDn.]
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3087)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3033)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2835)
at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2749)
at com.sun.jndi.ldap.LdapCtx.(LdapCtx.java:316)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:193)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:211)
at
com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
at
com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
at javax.naming.InitialContext.init(InitialContext.java:242)
at javax.naming.InitialContext.(InitialContext.java:216)
at
javax.naming.directory.InitialDirContext.(InitialDirContext.java:101)
at
org.wso2.carbon.user.core.ldap.LDAPConnectionContext.getContext(LDAPConnectionContext.java:167)
at
org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:156)
at
org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:100)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at
org.wso2.carbon.user.core.common.DefaultRealm.createObjectWithOptions(DefaultRealm.java:336)
at
org.wso2.carbon.user.core.common.DefaultRealm.initializeObjects(DefaultRealm.java:203)
at org.wso2.carbon.user.core.common.DefaultRealm.init(DefaultRealm.java:108)
at
org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:230)
at
org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:96)
at
org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:109)
at
org.wso2.carbon.user.core.internal.Activator.startDeploy(Activator.java:68)
at
org.wso2.carbon.user.core.internal.BundleCheckActivator.start(BundleCheckActivator.java:61)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
at
org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at
org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
[2015-11-30 13:13:36,827] ERROR
{org.wso2.carbon.user.core.ldap.LDAPConnectionContext} -  Trying again to
get connection.
[2015-11-30 13:13:36,829] ERROR

Re: [Dev] [IS][Greg] Configuring LDAP User Store in IS 5.0.0 and Greg 5.1.0

2015-11-30 Thread Chamalee De Silva
+ Darshana, Damith

On Mon, Nov 30, 2015 at 1:37 PM, Chamalee De Silva 
wrote:

> Hi devs,
>
> I have created a *read-write LDAP user store* as per [1] and there I have
> used *admin, admin* as credentials. I could successfully create it and
> start the server.
>
> Then I created a user with the following credentials.
>
> username : adminSOA
> password : 123456
> role : admin (default admin role)
>
> Then I followed [2] and configured a read-only (not read-write) external
> user store in Greg 5.1.0
>
> Given the user credentials as per the created user as above.
>
>
> The configuration is as follows in user-mgt.xml in Greg.
>
> **
> * true*
> *admin*
> **
> * adminSOA*
> * 123456*
> **
> *everyone *
> *jdbc/WSO2USER_DB*
> **
>
> *-*
>
> * uid=adminSOA,ou=system
> 123456   *
>
> But when I start Greg it gives the following error.
>
> [2015-11-30 13:13:36,823] ERROR
> {org.wso2.carbon.user.core.ldap.LDAPConnectionContext} -  Error obtaining
> connection. [LDAP: error code 49 - cannot bind the principalDn.]
> javax.naming.AuthenticationException: [LDAP: error code 49 - cannot bind
> the principalDn.]
> at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3087)
> at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3033)
> at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2835)
> at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2749)
> at com.sun.jndi.ldap.LdapCtx.(LdapCtx.java:316)
> at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:193)
> at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:211)
> at
> com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
> at
> com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
> at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
> at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
> at javax.naming.InitialContext.init(InitialContext.java:242)
> at javax.naming.InitialContext.(InitialContext.java:216)
> at
> javax.naming.directory.InitialDirContext.(InitialDirContext.java:101)
> at
> org.wso2.carbon.user.core.ldap.LDAPConnectionContext.getContext(LDAPConnectionContext.java:167)
> at
> org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:156)
> at
> org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:100)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
> at
> org.wso2.carbon.user.core.common.DefaultRealm.createObjectWithOptions(DefaultRealm.java:336)
> at
> org.wso2.carbon.user.core.common.DefaultRealm.initializeObjects(DefaultRealm.java:203)
> at
> org.wso2.carbon.user.core.common.DefaultRealm.init(DefaultRealm.java:108)
> at
> org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:230)
> at
> org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:96)
> at
> org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:109)
> at
> org.wso2.carbon.user.core.internal.Activator.startDeploy(Activator.java:68)
> at
> org.wso2.carbon.user.core.internal.BundleCheckActivator.start(BundleCheckActivator.java:61)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
> at
> org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
> at
> 

Re: [Dev] [IS][Greg] Configuring LDAP User Store in IS 5.0.0 and Greg 5.1.0

2015-11-30 Thread Chamalee De Silva
Hi Damith,
Still I get the same error.
 [LDAP: error code 49 - cannot bind the principalDn.]
Is there any other cause for this exception ?



Thanks

On Mon, Nov 30, 2015 at 3:27 PM, Damith Senanayake  wrote:

> Yes that is the issue. In the user-mgt-xml-of GREG, the password digest is
> configured as PLAIN_TEXT while in the other it is configured as SHA. They
> need to be the same.
>
> Hope this helps.
>
> Thanks
>
> On Mon, Nov 30, 2015 at 3:24 PM, Chamalee De Silva 
> wrote:
>
>> Hi Damith,
>>
>> Attached here are the user-mgt.xml files of Greg and IS respectively.
>>
>>
>> Thanks,
>> Chamalee
>>
>>
>> On Mon, Nov 30, 2015 at 3:16 PM, Damith Senanayake 
>> wrote:
>>
>>> Hi Chamalee,
>>>
>>> It could be that the password digest method is different when creating
>>> the user and later when configuring the user store manager. Could you
>>> please attach the user-mgt.xml?
>>>
>>> On Mon, Nov 30, 2015 at 1:40 PM, Chamalee De Silva 
>>> wrote:
>>>
 + Darshana, Damith

 On Mon, Nov 30, 2015 at 1:37 PM, Chamalee De Silva 
 wrote:

> Hi devs,
>
> I have created a *read-write LDAP user store* as per [1] and there I
> have used *admin, admin* as credentials. I could successfully create
> it and start the server.
>
> Then I created a user with the following credentials.
>
> username : adminSOA
> password : 123456
> role : admin (default admin role)
>
> Then I followed [2] and configured a read-only (not read-write)
> external user store in Greg 5.1.0
>
> Given the user credentials as per the created user as above.
>
>
> The configuration is as follows in user-mgt.xml in Greg.
>
> **
> * true*
> *admin*
> **
> * adminSOA*
> * 123456*
> **
> *everyone *
> *jdbc/WSO2USER_DB*
> **
>
> *-*
>
> * uid=adminSOA,ou=system
> 123456   *
>
> But when I start Greg it gives the following error.
>
> [2015-11-30 13:13:36,823] ERROR
> {org.wso2.carbon.user.core.ldap.LDAPConnectionContext} -  Error obtaining
> connection. [LDAP: error code 49 - cannot bind the principalDn.]
> javax.naming.AuthenticationException: [LDAP: error code 49 - cannot
> bind the principalDn.]
> at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3087)
> at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3033)
> at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2835)
> at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2749)
> at com.sun.jndi.ldap.LdapCtx.(LdapCtx.java:316)
> at
> com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:193)
> at
> com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:211)
> at
> com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
> at
> com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
> at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
> at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
> at javax.naming.InitialContext.init(InitialContext.java:242)
> at javax.naming.InitialContext.(InitialContext.java:216)
> at
> javax.naming.directory.InitialDirContext.(InitialDirContext.java:101)
> at
> org.wso2.carbon.user.core.ldap.LDAPConnectionContext.getContext(LDAPConnectionContext.java:167)
> at
> org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:156)
> at
> org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:100)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
> at
> org.wso2.carbon.user.core.common.DefaultRealm.createObjectWithOptions(DefaultRealm.java:336)
> at
> org.wso2.carbon.user.core.common.DefaultRealm.initializeObjects(DefaultRealm.java:203)
> at
> org.wso2.carbon.user.core.common.DefaultRealm.init(DefaultRealm.java:108)
> at
> org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:230)
> at
> org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:96)
> at
> org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:109)
> at
> 

Re: [Dev] [IS][Greg] Configuring LDAP User Store in IS 5.0.0 and Greg 5.1.0

2015-11-30 Thread Damith Senanayake
Hi Chamalee,

It could be that the password digest method is different when creating the
user and later when configuring the user store manager. Could you please
attach the user-mgt.xml?

On Mon, Nov 30, 2015 at 1:40 PM, Chamalee De Silva 
wrote:

> + Darshana, Damith
>
> On Mon, Nov 30, 2015 at 1:37 PM, Chamalee De Silva 
> wrote:
>
>> Hi devs,
>>
>> I have created a *read-write LDAP user store* as per [1] and there I
>> have used *admin, admin* as credentials. I could successfully create it
>> and start the server.
>>
>> Then I created a user with the following credentials.
>>
>> username : adminSOA
>> password : 123456
>> role : admin (default admin role)
>>
>> Then I followed [2] and configured a read-only (not read-write) external
>> user store in Greg 5.1.0
>>
>> Given the user credentials as per the created user as above.
>>
>>
>> The configuration is as follows in user-mgt.xml in Greg.
>>
>> **
>> * true*
>> *admin*
>> **
>> * adminSOA*
>> * 123456*
>> **
>> *everyone *
>> *jdbc/WSO2USER_DB*
>> **
>>
>> *-*
>>
>> * uid=adminSOA,ou=system
>>   123456   *
>>
>> But when I start Greg it gives the following error.
>>
>> [2015-11-30 13:13:36,823] ERROR
>> {org.wso2.carbon.user.core.ldap.LDAPConnectionContext} -  Error obtaining
>> connection. [LDAP: error code 49 - cannot bind the principalDn.]
>> javax.naming.AuthenticationException: [LDAP: error code 49 - cannot bind
>> the principalDn.]
>> at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3087)
>> at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3033)
>> at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2835)
>> at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2749)
>> at com.sun.jndi.ldap.LdapCtx.(LdapCtx.java:316)
>> at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:193)
>> at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:211)
>> at
>> com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
>> at
>> com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
>> at
>> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
>> at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
>> at javax.naming.InitialContext.init(InitialContext.java:242)
>> at javax.naming.InitialContext.(InitialContext.java:216)
>> at
>> javax.naming.directory.InitialDirContext.(InitialDirContext.java:101)
>> at
>> org.wso2.carbon.user.core.ldap.LDAPConnectionContext.getContext(LDAPConnectionContext.java:167)
>> at
>> org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:156)
>> at
>> org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:100)
>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>> at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
>> at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
>> at
>> org.wso2.carbon.user.core.common.DefaultRealm.createObjectWithOptions(DefaultRealm.java:336)
>> at
>> org.wso2.carbon.user.core.common.DefaultRealm.initializeObjects(DefaultRealm.java:203)
>> at
>> org.wso2.carbon.user.core.common.DefaultRealm.init(DefaultRealm.java:108)
>> at
>> org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:230)
>> at
>> org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:96)
>> at
>> org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:109)
>> at
>> org.wso2.carbon.user.core.internal.Activator.startDeploy(Activator.java:68)
>> at
>> org.wso2.carbon.user.core.internal.BundleCheckActivator.start(BundleCheckActivator.java:61)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
>> at
>> org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
>> at
>> org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
>> at
>> org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
>> at
>> org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
>> at
>>