Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

246
Views
How to get org_id as part of access token using Auth0?
  • I am try to get get org_id While generating using UserNamePassword authentication?
  • I have added rule as below
context.accessToken[namespace + 'org'] = context.organization;
  • After generating access token I have decoded it and I couldn't find org_id in json response
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Does namespace have a valid value e.g. http://www.myexample.com/org_id? If not it might be getting silently excluded

By default, Auth0 always enforces namespacing; any custom claims with non-namespaced identifiers will be silently excluded from tokens and silently ignored in Actions and Rules.

https://auth0.com/docs/secure/tokens/json-web-tokens/create-namespaced-custom-claims

You can debug these rules quite easily by adding some debug statements to your rule e.g. console.log(namespace + 'org') and installing and running the Real-time Webtask Logs extension

Finally, here's a full Rule example for adding a custom claim to access token:

function addAttributes(user, context, callback) {
  const namespace = configuration.Namespace;
  context.accessToken[`${namespace}org_id`] = 'test';
  callback(null, user, context);
}

note: configuration.Namespace is a rule setting with a value of something like http://www.myexample.com/

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!