How to view attached Social Auth profiles of user

Created on 27 March 2018, over 6 years ago
Updated 19 September 2023, 9 months ago

How Drupal user can review and manage all attached to him social profiles via Social Auth module?

✨ Feature request
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡¦πŸ‡²Armenia Murz Yerevan, Armenia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • πŸ‡ͺπŸ‡ΈSpain aleix

    I am working on this in the Issue's fork, it works ok with 4.0.x, and also I add the delete button to remove an existing social_auth entity for a specific user.

    But I cannot find a way to set a new tab for the user using the new view social_auth_profiles. I have followed the same procedure as https://www.webwash.net/custom-tab-user-profile-page-views-drupal-8/ .

    Inputs on this are welcome.

    Another module that is adding a view to user tabs is commerce_order from commerce module, the only difference is the validation criteria of argument which uses this : https://git.drupalcode.org/project/commerce/-/blob/8.x-2.x/src/Plugin/vi... . But i don't think it changes anything (will test it picking the argument_validator plugin code to social_auth... )

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    Patch Failed to Apply
  • πŸ‡ͺπŸ‡ΈSpain aleix

    I think that this is not possible because of: https://www.drupal.org/project/drupal/issues/2528166 ✨ Upcast named arguments/named parameters in views Needs work . While not able to use named parameters we cannot add tabs to user. If anyone had success in creating a user tab with views let me know.

    So by now a new controller shows a list in user/{user}/social-auth-profiles.

    What is done in the MR:
    - The controller tries to render the (included) view with id views.view.social_auth_profiles, if not found, it will use the included entitylistbuilder but limiting the list to show just the social_auth profiles belonging to user.

  • Status changed to Needs review about 1 year ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    3 pass, 4 fail
  • @aleix opened merge request.
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    5 pass
  • Status changed to Needs work about 1 year ago
  • πŸ‡ͺπŸ‡ΈSpain aleix

    Needs:
    - Add tests
    - social_auth entity access class

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    Unable to generate test groups
  • Status changed to Needs review about 1 year ago
  • πŸ‡ͺπŸ‡ΈSpain aleix

    Ready to review!
    As you can see there's a new access control for social auth entity, also a new permission, "delete own social auth profiles" . Also I have done functional tests for social auth removal and social auth profiles lists access and operations.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    9 pass
  • Status changed to Needs work about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States wells Seattle, WA

    @aleix --

    Thanks for taking this up! I have tested the branch out and it works as designed however I have a few bigger concerns:

    1. I'd rather not have a hard requirement on Views. While it's highly likely for sites to have Views installed and enabled I don't think Social Auth should be requiring it. We'll want to make this an optional feature.
    2. There is currently no migration path. We'd want an update hook that checks if Views is enabled and installs the new view.
    3. The view itself is pretty basic. Ideally there should be a way to search on username and filter by provider.
    4. While the view is useful I would rather be able to see/manage profiles directly from the user edit form. This would take better advantage of the core user functionality and I think entirely eliminate the need for a custom view. I can't recall off the top of my head but I know there is a some module that has entities related to a user that can accessed and managed from the user edit page easily. This would provide a good example and I'll update again if I can remember what module it is...
  • πŸ‡ͺπŸ‡ΈSpain aleix

    To address what you said in point 1 and 2, Maybe the view could be placed in config/optional as said in: https://www.drupal.org/node/2453919 β†’ , so view will be installed when dependencies are met.

    About point 3, I am agree that view is basic, it could be expanded to include search and filters.

    Referring the 4th point, are you thinking with dynamic field with a fieldwidget to be seen in edit form? Or a block with entities list shown in edit form? The way I did is like activitypub module is already doing ( https://git.drupalcode.org/project/activitypub/-/blob/1.0.x/activitypub.... ), also how openid did it ( https://git.drupalcode.org/project/openid_connect/-/blob/2.x/openid_conn... ). Anyway, the example that you said would be great.

  • πŸ‡ΊπŸ‡ΈUnited States wells Seattle, WA

    To address what you said in point 1 and 2, Maybe the view could be placed in config/optional as said in: https://www.drupal.org/node/2453919 β†’ , so view will be installed when dependencies are met.

    Yep I think that makes sense. Though it would still only address new installs -- we'd want an update hook as well.

    Referring the 4th point, are you thinking with dynamic field with a fieldwidget to be seen in edit form? Or a block with entities list shown in edit form?

    I think a block with entities shown in the edit form (with the delete option for each entity). Social Auth Twitter is the module I was thinking of that does something like this -- see: https://git.drupalcode.org/project/social_post_twitter/-/blob/3.x/social.... Not sure if that approach is still the best for 10.x+ but that's the idea.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update 11 months ago
    9 pass
  • πŸ‡ͺπŸ‡ΈSpain aleix

    Here again! Let's see if it is better now.
    What I have done:
    - A field in user form to list both the connected social auth profiles and the networks available to connect. In the case of connected ones it just lists the profile with greater id, so it will not show duplicated profiles for each network, also it will show the social auth profile status so will show if token is expired or already valid, also it will allow the operations of removal existing connected profiles auths or to connect. It's an adaptation of the social_auth_twitter implementation that wells suggests, but adapting to a generic use case.
    - View config moved to config/optional as said in previous comments.
    - View import when updating the module.

    Next image summarize the new field:

  • Status changed to Needs review 11 months ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update 10 months ago
    9 pass
  • Status changed to Needs work 10 months ago
  • πŸ‡ΊπŸ‡ΈUnited States wells Seattle, WA
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update 10 months ago
    9 pass
  • Status changed to Needs review 10 months ago
  • πŸ‡ΊπŸ‡ΈUnited States wells Seattle, WA
  • Status changed to Needs work 10 months ago
  • πŸ‡ΊπŸ‡ΈUnited States wells Seattle, WA
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update 10 months ago
    9 pass
  • Status changed to Needs review 10 months ago
  • Status changed to Fixed 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States wells Seattle, WA

    Thanks for you work on this, @aleix! This is a great new feature.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024