Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findEpersonByNetId should stop searching when it finds an eperson #1135

Open
kosarko opened this issue Nov 21, 2024 · 0 comments
Open

findEpersonByNetId should stop searching when it finds an eperson #1135

kosarko opened this issue Nov 21, 2024 · 0 comments
Assignees
Labels

Comments

@kosarko
Copy link
Member

kosarko commented Nov 21, 2024

https://github.com/dataquest-dev/DSpace/blob/c25374e0b2ff6e9f8aba429c8372a466affbcad5/dspace-api/src/main/java/org/dspace/authenticate/clarin/ClarinShibAuthentication.java#L1321-L1345

The for cycle always runs through all possibilities, there's no break or return inside. It should stop when it finds an eperson based on some netid header.

We've seen broken logins, the idp is sending both an eppn and persistent-id, the database contains the eppn as the netid, but based on the logs any further login attempt fails as it tries to create a new user based on the persistent-id

2024-11-21 11:00:50,022 ERROR unknown unknown org.dspace.authenticate.clarin.ClarinShibAuthentication @ Unable to parse schema and field string from name: 'cn'
2024-11-21 11:00:50,022 INFO  unknown unknown org.dspace.authenticate.clarin.ClarinShibAuthentication @ Unable to identify EPerson based upon Shibboleth netid header: 'persistent-id'='REDACTED[https://cas.cuni.cz/idp/shibboleth]'.
2024-11-21 11:00:50,022 INFO  unknown unknown org.dspace.authenticate.clarin.ClarinShibAuthentication @ Identified EPerson based upon Shibboleth email header: 'mail'='[email protected]'.
2024-11-21 11:00:50,022 ERROR unknown unknown org.dspace.authenticate.clarin.ClarinShibAuthentication @ The identified EPerson based upon Shibboleth email header, 'mail'='[email protected]', is locked to another netid: '[email protected][https://cas.cuni.cz/idp/shibboleth]'. This might be a possible hacking attempt to steal another users credentials. If the user's netid has changed you will need to manually change it to the correct value or unset it in the database.                                                                2024-11-21 11:00:50,022 INFO  unknown unknown org.dspace.app.rest.security.EPersonRestAuthenticationProvider @ anonymous::failed_login:email=null, result=4                                                       
@kosarko kosarko self-assigned this Nov 21, 2024
kosarko added a commit that referenced this issue Nov 21, 2024
…an eperson

- moved the `return eperson` inside the for cycle (after eperson non null
check).
- removed the eperson param (both callers were passing in `null`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant