Username character limit preventing login via SAML

Bug #1486699 reported by Kevin Rickis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon
1.10
Fix Released
High
Robert Lyon
1.9
Fix Released
High
Robert Lyon
15.04
Fix Released
High
Robert Lyon

Bug Description

Mahara version15.04.1

This report is in relation to my earlier forum post https://mahara.org/interaction/forum/topic.php?id=7310 but I have tracked down the problem.

Issue:

User is logging in via SAML and the user is being auto-created on first login.
Remote username is a unique id (example: 51c717bc-425c-4b31-9674-d38ba03b4f1f)
When the user tries subsequent logins they are rejected with a error message that the user already exists and cannot be created.

Reason:

When the user is auto-created only the first 30 characters of the unique id are stored in the username field so the user is not recognised as being on the system when cheaked agains the full username from the login.
The system then tries to auto-create the user, which fails because the full unique id is stored in the 'auth_remote_user' table.

Solution:

Changing $maxlen from 30 to 40 in function get_new_username() of user.php populates the user name with the full unique id.

Maybe this could be a configurable option?

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/5160

Revision history for this message
Robert Lyon (robertl-9) wrote :

Hi Kevin,

I've added a patch to our review system: https://reviews.mahara.org/#/c/5160/

Can you let me know if that change fixes the problem you are having

Cheers

Robert

Changed in mahara:
milestone: none → 15.10.0
assignee: nobody → Robert Lyon (robertl-9)
importance: Undecided → High
status: New → In Progress
Revision history for this message
Kevin Rickis (rdx565) wrote :

Hi Robert,

yes that fixes the issue. :)

Cheers,

Kevin

no longer affects: mahara/trunk
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5160
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/dc3b3292415b17730e809afc0a9bfd80decd19a8
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit dc3b3292415b17730e809afc0a9bfd80decd19a8
Author: Kevin Rickis <email address hidden>
Date: Mon Aug 24 09:34:22 2015 +1200

Bug 1486699: get_new_username() truncating username badly for SAML

Ends up with username in auth_remote_user being different to the
username in usr table.

behatnotneeded

Change-Id: If6a5a18360ef82da2e3a709899e7d4d1624e8fab
Signed-off-by: Robert Lyon <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "15.04_STABLE" branch: https://reviews.mahara.org/5433

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "1.10_STABLE" branch: https://reviews.mahara.org/5434

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5434
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/884b9f71d4479cb604ee071e32ec7480ac3ed203
Submitter: Robert Lyon (<email address hidden>)
Branch: 1.10_STABLE

commit 884b9f71d4479cb604ee071e32ec7480ac3ed203
Author: Kevin Rickis <email address hidden>
Date: Mon Aug 24 09:34:22 2015 +1200

Bug 1486699: get_new_username() truncating username badly for SAML

Ends up with username in auth_remote_user being different to the
username in usr table.

behatnotneeded

Change-Id: If6a5a18360ef82da2e3a709899e7d4d1624e8fab
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit dc3b3292415b17730e809afc0a9bfd80decd19a8)

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "1.9_STABLE" branch: https://reviews.mahara.org/5435

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5435
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/d6af8c863fb020477dfe95b155d6f639704c0568
Submitter: Robert Lyon (<email address hidden>)
Branch: 1.9_STABLE

commit d6af8c863fb020477dfe95b155d6f639704c0568
Author: Kevin Rickis <email address hidden>
Date: Mon Aug 24 09:34:22 2015 +1200

Bug 1486699: get_new_username() truncating username badly for SAML

Ends up with username in auth_remote_user being different to the
username in usr table.

behatnotneeded

Change-Id: If6a5a18360ef82da2e3a709899e7d4d1624e8fab
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit dc3b3292415b17730e809afc0a9bfd80decd19a8)
(cherry picked from commit 884b9f71d4479cb604ee071e32ec7480ac3ed203)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/5433
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/5868c6a312a2f8c4982db5588235d9b1e433194a
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.04_STABLE

commit 5868c6a312a2f8c4982db5588235d9b1e433194a
Author: Kevin Rickis <email address hidden>
Date: Mon Aug 24 09:34:22 2015 +1200

Bug 1486699: get_new_username() truncating username badly for SAML

Ends up with username in auth_remote_user being different to the
username in usr table.

behatnotneeded

Change-Id: If6a5a18360ef82da2e3a709899e7d4d1624e8fab
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit dc3b3292415b17730e809afc0a9bfd80decd19a8)

Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
no longer affects: mahara/15.10
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.