Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enhancing CAS authentication handling by extracting user attributes#59951

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
erseco wants to merge1 commit intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromerseco:7.3

Conversation

erseco
Copy link

@ersecoerseco commentedMar 10, 2025
edited
Loading

QA
Branch?7.3
Bug fix?no
New feature?yes
Deprecations?no
Issues
LicenseMIT

Description

This pull request enhances the CAS authentication process by extracting user attributes from the CAS response and passing them to theUserBadge. This ensures that additional information, such as email or roles, can be accessed within authentication workflows.

Changes

Test Updates

Why?

  • Provides better integration with Symfony’s security system.
  • Ensures CAS user attributes (like email and roles) are available in authentication workflows.
  • Improves maintainability by aligning with how attributes are handled in OIDC authentication.

Tests updated and verified
No backward compatibility breaks

Let me know if any adjustments are needed! 🚀

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.3 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot

This comment was marked as resolved.

@welcoMattic
Copy link
Member

@nacorp friendly ping 😉

nacorp reacted with hooray emoji

@nacorp
Copy link
Contributor

That's a cool update of the CAS authenticator@erseco ! 👏

@chalasr
Copy link
Member

OIDC handlers create aOidcUser from data equivalent to the ones this change gets from the CAS2 success response, do we need such user object here? Just wondering, it's fine if we don't.

@erseco
Copy link
Author

erseco commentedMar 18, 2025
edited
Loading

@chalasr Thanks for your question!

Regarding whether we need a specific user object likeOidcUser, I don't think it's necessary in this case.

According to the [CAS protocol specification](https://apereo.github.io/cas/7.0.x/protocol/CAS-Protocol-Specification.html#257-example-response-with-custom-attributes), CAS attributes are included directly in the XML/JSON response:

<cas:serviceResponsexmlns:cas="http://www.yale.edu/tp/cas">  <cas:authenticationSuccess>    <cas:user>username</cas:user>    <cas:attributes>      <cas:firstname>John</cas:firstname>      <cas:lastname>Doe</cas:lastname>      <cas:email>jdoe@example.org</cas:email>      <cas:affiliation>staff</cas:affiliation>      <cas:affiliation>faculty</cas:affiliation>    </cas:attributes>  </cas:authenticationSuccess></cas:serviceResponse>

The changes in this PR extract these attributes and pass them through theUserBadge, ensuring the authentication workflow receives all necessary data without requiring a dedicated object. Since we're simply transferring attributes for use by the application's user provider, this approach is sufficient.

I've committed the necessary changes to align with the CAS documentation. All tests now pass after adding some additional cases. However, I'm still encountering issues inPHP 8.2 (low-deps).

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@welcoMatticwelcoMatticwelcoMattic left review comments

@chalasrchalasrAwaiting requested review from chalasrchalasr is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

6 participants
@erseco@carsonbot@welcoMattic@nacorp@chalasr@fabpot

[8]ページ先頭

©2009-2025 Movatter.jp