Context.request.query with Universal login

Using Lock I can pass a value to Auth0 Rules using a property on the params object like this:

 var lockAuthOptions = {
        redirectUrl: "",
        responseType: 'token id_token',
        params: {
            audience: 'http://myaudience',
            myproperty: "hello rule!!"

and access it in a rule like this:

function (user, context, callback) {
   var value = context.request.query.myproperty;
return callback(null, user, context);

How do I accomplish the same using Universal login and WebAuth?

var webAuth = new auth0.WebAuth({
        domain: "",
        clientID: "clientId",
        responseType: 'token id_token',
        params: {
            myproperty: "Not working"
        myproperty: "Not working,
        audience: "https://myaudience",
        scope: "scopes",
        extraParams: { myproperty: "Not working" },
        state: "mystate",
        redirectUri: ""

Hi @sbf,

According to the Auth0.js docs you pass additional params when you call the authorize method:

  //Any additional options can go here

That should work. It was a little buried in the docs and took some work to find!

Let me know how it goes.



Thanks a lot! It works.

I’ve been staring at the table with the parameters in the documentation and overseen the black box below which you are referring to.

Thanks again,


Glad you got a solution :slight_smile: !


This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.