How to add data to id_token un auth0? - cniackz/public GitHub Wiki

Video: https://auth0.com/blog/adding-custom-claims-to-id-token-with-auth0-actions/

Answer: via Actions

Create an action like this:

exports.onExecutePostLogin = async (event, api) => {
  if(event.authorization){
    api.idToken.setCustomClaim("celis","maximo_nivel");
  }
};

Above will give you an addition

{
  "https://min.io/policy": "consoleAdmin",
  "celis": "maximo_nivel",
  "iss": "https://dev-xqm5ioqlmy7qyjvl.us.auth0.com/",
  "aud": "rMVc40T7fwgbEez1svp8wmjBtSaoKIOJ",
  "iat": 1717778270,
  "exp": 1718642270,
  "sub": "auth0|665f785cadeaa2fb65528ef3",
  "sid": "55ArJR6CtIo6pbSU84_kNhb4tm8sL65A"
}