By: Gaurav Jagtap user 02 Nov 2019 at 10:52 a.m. CDT

6 Responses
Gaurav Jagtap gravatar
## Expect Behavior Login as a user using his/her email address and not the username, following the below article : https://gluu.org/docs/ce/4.0/operation/faq/#request-email-instead-of-username-for-login ## Actual Behaviour After changing the primaryKey and Local primary key both to mail, oxAuth does not let you login via email. If I provide the uid instead of the email with the same configuration, I'm then able to login. I checked the Ldap configuration and this is the json ``` { "type":"auth", "name":"auth_ldap_server", "level":0, "priority":0, "enabled":false, "version":1, "fields":[ ], "config":{ "configId":"auth_ldap_server", "bindDN":"cn=directory manager", "bindPassword":"...", "servers":[ "localhost:1636" ], "maxConnections":1000, "useSSL":true, "baseDNs":[ "ou=people,o=gluu" ], "primaryKey":"mail", "localPrimaryKey":"mail", "useAnonymousBind":false, "enabled":false, "version":0, "level":0 } } ``` I have 3 instances all with a fresh installation, having the same behavior.

By Mohib Zico staff 02 Nov 2019 at 10:57 a.m. CDT

Mohib Zico gravatar
@Sahil.Arora: Can you please test this issue when you can manage some time?

By Gaurav Jagtap user 02 Nov 2019 at 11:02 a.m. CDT

Gaurav Jagtap gravatar
``` 2019-11-02 15:42:40,984 INFO [qtp105704967-13] [org.gluu.oxauth.service.AuthenticationService] (AuthenticationService.java:597) - Attempting to redirect user: User: org.gluu.oxauth.model.common.User@7390795f 2019-11-02 15:42:40,989 INFO [qtp105704967-13] [org.gluu.oxauth.auth.Authenticator] (Authenticator.java:426) - Authentication success for User: 'admin' 2019-11-02 15:42:41,265 INFO [qtp105704967-13] [org.gluu.oxauth.auth.Authenticator] (Authenticator.java:276) - Authentication success for Client: '1001.e6231a4c-014a-458a-9728-e0b32b7d0827' 2019-11-02 15:44:31,299 INFO [metrics-reporter-1-thread-1] [org.gluu.oxauth.service.AppInitializer] (AppInitializer.java:363) - Created persistenceMetricEntryManager: org.gluu.persist.ldap.impl.LdapEntryManager@4a8eb4be with operation service: org.gluu.persist.ldap.operation.impl.LdapOperationsServiceImpl@722451 2019-11-02 16:00:03,524 INFO [qtp105704967-11] [org.gluu.oxauth.auth.Authenticator] (Authenticator.java:223) - Authentication failed for 'admin@sample-email.com' 2019-11-02 16:00:10,253 INFO [qtp105704967-12] [org.gluu.oxauth.service.AuthenticationService] (AuthenticationService.java:589) - Attempting to redirect user: SessionUser: SessionState {dn='d0426b29-661d-4a9c-ae4d-07d9677ed9a5', id='d0426b29-661d-4a9c-ae4d-07d9677ed9a5', lastUsedAt=Sat Nov 02 16:00:10 UTC 2019, userDn='inum=7540b7da-b72e-4a23-9f92-43751dbf66f1,ou=people,o=gluu', authenticationTime=Sat Nov 02 16:00:10 UTC 2019, state=authenticated, sessionState='719b523d438293559aabd148cd543a56205098d0a691a26337dab0f0afbefd93.fc87ee95-f893-4ddb-92c3-718d71fed63f', permissionGranted=null, isJwt=false, jwt=null, permissionGrantedMap=org.gluu.oxauth.model.common.SessionIdAccessMap@3d3a7585, involvedClients=null, sessionAttributes={auth_external_attributes=null, opbs=d06accc5-c5c1-4c94-a0e8-1b413dbb5330, response_type=code, nonce=30bfde0d-b791-40e0-9859-cdbf646dde5a, client_id=1001.e6231a4c-014a-458a-9728-e0b32b7d0827, auth_step=1, acr=simple_password_auth, remote_ip=3.82.123.220, auth_user=admin, scope=openid profile email user_name, acr_values=simple_password_auth, redirect_uri=https://.../identity/authcode.htm, state=e6f131fd-54bc-4030-99f0-da423b055420}, persisted=true} 2019-11-02 16:00:10,254 INFO [qtp105704967-12] [org.gluu.oxauth.service.AuthenticationService] (AuthenticationService.java:597) - Attempting to redirect user: User: org.gluu.oxauth.model.common.User@3b04354d 2019-11-02 16:00:10,256 INFO [qtp105704967-12] [org.gluu.oxauth.auth.Authenticator] (Authenticator.java:426) - Authentication success for User: 'admin' 2019-11-02 16:00:10,467 INFO [qtp105704967-12] [org.gluu.oxauth.auth.Authenticator] (Authenticator.java:276) - Authentication success for Client: '1001.e6231a4c-014a-458a-9728-e0b32b7d0827' ``` This is what oxauth.log has.

By Gaurav Jagtap user 04 Nov 2019 at 10:49 a.m. CST

Gaurav Jagtap gravatar
Hi Just wondering if anyone was able to find any solution to this? or why this is happening?

By Sahil Arora staff 05 Nov 2019 at 9:32 p.m. CST

Sahil Arora gravatar
Hi Gaurav, After changing Primary Key and Local Primary Key to mail, Please Click on Activate button on same screen (Configuration > Manage Authentication) and wait for 2-3 mins before trying again. Let me know how it goes.

By Gaurav Jagtap user 06 Nov 2019 at 8:55 a.m. CST

Gaurav Jagtap gravatar
Hi Sahil, I did as you asked, OxAuth is now returning the following error message I try logging in (before the login page even loads) https://prnt.sc/ptadx1 An unexpected error has occured at null login.errorSessionInvalidMessage OxTrust.log ``` 2019-11-06 14:46:05,826 INFO [metrics-reporter-1-thread-1] [org.gluu.oxauth.service.AppInitializer] (AppInitializer.java:363) - Created persistenceMetricEntryManager: org.gluu.persist.ldap.impl.LdapEntryManager@12807a3 with operation service: org.gluu.persist.ldap.operation.impl.LdapOperationsServiceImpl@7e3650ee 2019-11-06 14:47:41,974 INFO [qtp105704967-12] [org.gluu.oxauth.auth.Authenticator] (Authenticator.java:223) - Authentication failed for 'admin@example.com' 2019-11-06 14:47:44,933 INFO [qtp105704967-14] [org.gluu.oxauth.service.AuthenticationService] (AuthenticationService.java:589) - Attempting to redirect user: SessionUser: SessionState {dn='68a576f1-dace-4187-abe4-8e68dead97ea', id='68a576f1-dace-4187-abe4-8e68dead97ea', lastUsedAt=Wed Nov 06 14:47:44 UTC 2019, userDn='inum=5bf4cae8-98c0-4214-85ed-bbb29dc5e99f,ou=people,o=gluu', authenticationTime=Wed Nov 06 14:47:44 UTC 2019, state=authenticated, sessionState='b8639e9be80678ef5638c049dbe6fb684b754505d33160f6d0e31327bf1b2fba.99f4b0ec-73be-4667-9a73-013cde38a626', permissionGranted=null, isJwt=false, jwt=null, permissionGrantedMap=org.gluu.oxauth.model.common.SessionIdAccessMap@4b3adb8, involvedClients=null, sessionAttributes={auth_external_attributes=null, opbs=04f512c0-f368-4438-98d7-a85e9a6fc304, response_type=code, nonce=6c344a09-ed48-4319-a8c4-04dacad0ed63, client_id=1001.1234f608-39df-4ec4-89ce-195aea147b37, auth_step=1, acr=simple_password_auth, remote_ip=69.165.170.105, auth_user=admin, scope=openid profile email user_name, acr_values=simple_password_auth, redirect_uri=https://.../identity/authcode.htm, state=603478f3-0f68-4674-9e5b-57ed5277d9ef}, persisted=true} 2019-11-06 14:47:44,934 INFO [qtp105704967-14] [org.gluu.oxauth.service.AuthenticationService] (AuthenticationService.java:597) - Attempting to redirect user: User: org.gluu.oxauth.model.common.User@31bc201c 2019-11-06 14:47:44,936 INFO [qtp105704967-14] [org.gluu.oxauth.auth.Authenticator] (Authenticator.java:426) - Authentication success for User: 'admin' 2019-11-06 14:47:45,254 INFO [qtp105704967-14] [org.gluu.oxauth.auth.Authenticator] (Authenticator.java:276) - Authentication success for Client: '1001.1234f608-39df-4ec4-89ce-195aea147b37' 2019-11-06 14:48:35,626 INFO [Thread-117] [org.gluu.oxauth.service.AppInitializer] (AppInitializer.java:473) - Recreated instance persistenceAuthEntryManager: [org.gluu.persist.ldap.impl.LdapEntryManager@2de71c3e] 2019-11-06 14:49:56,667 ERROR [qtp105704967-14] [gluu.oxauth.authorize.ws.rs.AuthorizeAction] (AuthorizeAction.java:251) - Failed to get CustomScriptConfiguration. auth_step: 1, acr_values: simple_password_auth 2019-11-06 14:50:03,380 ERROR [qtp105704967-13] [gluu.oxauth.authorize.ws.rs.AuthorizeAction] (AuthorizeAction.java:251) - Failed to get CustomScriptConfiguration. auth_step: 1, acr_values: simple_password_auth 2019-11-06 14:50:12,451 ERROR [qtp105704967-11] [gluu.oxauth.authorize.ws.rs.AuthorizeAction] (AuthorizeAction.java:251) - Failed to get CustomScriptConfiguration. auth_step: 1, acr_values: simple_password_auth 2019-11-06 14:50:47,816 ERROR [qtp105704967-17] [gluu.oxauth.authorize.ws.rs.AuthorizeAction] (AuthorizeAction.java:251) - Failed to get CustomScriptConfiguration. auth_step: 1, acr_values: simple_password_auth 2019-11-06 14:51:15,738 ERROR [qtp105704967-13] [gluu.oxauth.authorize.ws.rs.AuthorizeAction] (AuthorizeAction.java:251) - Failed to get CustomScriptConfiguration. auth_step: 1, acr_values: simple_password_auth ```

By Sahil Arora staff 12 Nov 2019 at 10:32 p.m. CST

Sahil Arora gravatar
Can you please attach the screenshot for `Manage LDAP Authentication`, and `Default Authentication Method` Screens