Simple oauth add dynamic scope option with roles account

Created on 22 January 2024, over 1 year ago
Updated 4 February 2024, over 1 year ago

Hi All

I have a Drupal web application with users who have various roles, and
I need them to access with the same roles using simple oauth access token to their resource
I don't need to specify lots of consumers and scopes to manage roles,
I just need the user to access with mobile app with the same roles
that they have in their web account

Proposed resolution

I propose In dynamic scope to add a scope option "roles account" to enable user to use his roles account with Access token
Or other solution configure no scope in your consumer.

Please help me to figure out this problem with any solutions you suggest!
Thank you

Feature request
Status

Closed: duplicate

Version

6.0

Component

Miscellaneous

Created by

🇱🇧Lebanon m.attar

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

Comments & Activities

  • Issue created by @m.attar
  • Status changed to Postponed: needs info over 1 year ago
  • 🇳🇱Netherlands bojan_dev

    If I understand you correctly, you want to authorize without specifying a scope? This is currently not possible, but there is a feature request which would solve your issue: 🐛 Allow default scopes to be set regardless of grant type Needs work
    This would make it possible to set default scopes from the consumer for the authorization grant type, this way you could omit the scopes when authorizing.

  • Status changed to Active over 1 year ago
  • 🇱🇧Lebanon m.attar

    I want to use Authorization Code Grant type with the roles that exist in our account when created instead of scopes

  • 🇳🇱Netherlands bojan_dev

    Scopes are now config entities and they can be mapped to roles, so you have the possibility to use scopes as roles like simple_oauth:5.2 does and you could even automate the scope creation process when roles are being created by implementing event subscribers/hook_entity_update.

    To map a scope to a role via the UI:

    • Add dynamic scope: "/admin/config/people/simple_oauth/oauth2_scope/dynamic/add"
    • Set granularity to "Role"
    • Select a role
  • Status changed to Closed: duplicate over 1 year ago
  • 🇱🇧Lebanon m.attar

    Thank you for your comment, but what you mentioned is unrelated to my problem.

    Actually, it is related to this issue Provide default scopes if client is not requesting a specific scope Provide default scopes if client is not requesting a specific scope Closed: outdated I applied the mentioned patch and it solved the problem https://www.drupal.org/files/issues/provide_default_scopes-2857930-2.patch

    Thank you

Production build 0.71.5 2024