Hi.
We’re trying to create a test application that will programmatically log in a couple of users.
We’re getting this error:
ReferenceError: window is not defined
at Object.getWindow (/Users/me/SoftwareDev/shout-admin/node_modules/auth0-js/dist/auth0.min.js:8:40186)
at Object.randomString (/Users/me/SoftwareDev/shout-admin/node_modules/auth0-js/dist/auth0.min.js:8:86524)
at TransactionManager.generateTransaction (/Users/me/SoftwareDev/shout-admin/node_modules/auth0-js/dist/auth0.min.js:8:88775)
at TransactionManager.process (/Users/me/SoftwareDev/shout-admin/node_modules/auth0-js/dist/auth0.min.js:8:88378)
at WebAuth.login (/Users/me/SoftwareDev/shout-admin/node_modules/auth0-js/dist/auth0.min.js:8:122023)
We’re using the nodejs repository, and requiring it with
var auth0 = require("auth0-js");
Our code is
var webAuth = new auth0.WebAuth({
domain: 'xxx.eu.auth0.com',
clientID: 'xxxx',
redirectUri: 'http://localhost:3333/mockUsers',
responseType: 'token id_token'
});
webAuth.login({
realm: 'Username-Password-Authentication',
username: 'bingo',
password: 'xxxx',
audience: 'https://api.xxx.io/'
});
Additionally, once this is working, can we actually retrieve the token without redirecting to a new page?