I would like to get the hostname, timezone and the IP Address in the Auth Response. What is the best way to return this data?
I have tried this using a rule, but the auth response does not give back the data.
The rule is as follows:
function (user, context, callback) {
const namespace = ‘https://mansyscloud.eu.auth0.com/’;
context.idToken[namespace + ‘host’] = context.request.query.host; //obtain the host value passed in step 1, in the context object
callback(null, user, context);
}
I am passing the hostname in the Authentication Request
auth0 = new auth0.WebAuth({
clientID: AUTH_CONFIG.clientID,
domain: AUTH_CONFIG.domain,
host: window.location.hostname,
responseType: ‘token id_token’,
redirectUri: AUTH_CONFIG.callbackURL
});