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

Replace auth0-authorization-extension rule with an action #379

Open
philippsteinberg opened this issue Apr 12, 2024 · 17 comments
Open

Replace auth0-authorization-extension rule with an action #379

philippsteinberg opened this issue Apr 12, 2024 · 17 comments

Comments

@philippsteinberg
Copy link

At the moment the extension uses a rule to add the groups, roles and permissions to the user.
The rule is automaticly installed when adding the extension and part of this repo
https:/auth0/auth0-authorization-extension/blob/master/server/lib/rules/authorize.js

Since rules are deprecated this extenstion will no longer work out of the box after Nov 18, 2024
Is it planned to replace the rule with an action?

@RDP07
Copy link

RDP07 commented Jun 10, 2024

Any answer here or date of when an answer might be coming for this?

@entropic489
Copy link

In the documentation for converting Rules to Actions, there's a limitation that directly affects this: https://auth0.com/docs/customize/actions/migrate/migrate-from-rules-to-actions#understand-limitations

Rules can add properties to the User object that then gets passed to subsequent Rules. Actions cannot do this.

@entropic489
Copy link

entropic489 commented Jul 16, 2024

Got a workaround: you can use an Action to set a custom claim. User groups from Authorization Extension are synced to event.user.app_metadata.authorization.groups.

exports.onExecutePostLogin = async (event, api) => {
  const namespace = "https://test-namespace.com"
  const groups = event.user.app_metadata.authorization.groups;

  if (event.authorization) {
    // Set claims 
    api.idToken.setCustomClaim('${namespace}/groups', groups);
  }
};

Just can't override the reserved groups claim.

@simmerkaer
Copy link

That's cool and all, but what happens after November 18th, when the AuthorizationExtension rule no longer works and thus will not be setting the app_metadata values?

@hibiitt
Copy link

hibiitt commented Aug 29, 2024

Hello, is there any information on this? I would like an answer to the last question from @simmerkaer.

@HirenPatel2791
Copy link

+1

5 similar comments
@fujifilm-alinea
Copy link

+1

@mikvas-paf
Copy link

+1

@fsevilla06
Copy link

+1

@AndreaLandiArk
Copy link

+1

@hefnat
Copy link

hefnat commented Oct 4, 2024

+1

@AndreaLandiArk
Copy link

Got a workaround: you can use an Action to set a custom claim. User groups from Authorization Extension are synced to event.user.app_metadata.authorization.groups.

exports.onExecutePostLogin = async (event, api) => {
  const namespace = "https://test-namespace.com"
  const groups = event.user.app_metadata.authorization.groups;

  if (event.authorization) {
    // Set claims 
    api.idToken.setCustomClaim('${namespace}/groups', groups);
  }
};

Just can't override the reserved groups claim.

I also resolved this way

@hefnat
Copy link

hefnat commented Oct 4, 2024

Got a workaround: you can use an Action to set a custom claim. User groups from Authorization Extension are synced to event.user.app_metadata.authorization.groups.

exports.onExecutePostLogin = async (event, api) => {
  const namespace = "https://test-namespace.com"
  const groups = event.user.app_metadata.authorization.groups;

  if (event.authorization) {
    // Set claims 
    api.idToken.setCustomClaim('${namespace}/groups', groups);
  }
};

Just can't override the reserved groups claim.

I also resolved this way

Since this is making use of the app_metadata field, I'm concerned it will stop working after EOL of Rules

@alphonsoTheGreat
Copy link

+1

2 similar comments
@tomerblecher
Copy link

+1

@ichalyk
Copy link

ichalyk commented Oct 10, 2024

+1

@ahmedrage
Copy link

It is pretty concerning that we haven't gotten an answer to this since April. Will this extension stop functioning on Nov 18? Do we need to migrate to the core authorization features?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests