Auth0 Home Blog Docs

400 error after call to auth0.checkSession

error

#1

My app is logged in with Google and whenever I call auth0.checkSession I get a 400 error page. I’m passing the same params that I use for auth0.authorize.


#2

I just did a quick test using Google authentication followed by a checkSession call and did not experience any issue. The most likely reason for the error is that you did not correctly configure your client application for the ability to call that method; for example, incorrectly set Allowed Web Origins in the client settings.

You should also include more detailed information about the error and not just the status code. In general the response for a 400 will include additional hints at what could be wrong.


#3

@jmangelo How can we get ‘more detailed information’ about the error? I’m also receiving this error, too. here’s the code I’m doing to set this up:

var current_time = Date.now() / 1000;
    if (expiry >= current_time) {
        // hasn't expired yet.
        return;
    }

    // JWT has expired, so lets try and silently, auto refresh.
    
    var result = webAuth.checkSession({
        responseType: "token id_token"
    }, function(err, authresult) {
        alert("error silent retry");
        alert(err);
        console.log("here.");
    });

I’ve also logged in via the auth0 login page, and chose “Google” as my AuthProvider, using the following login code:

webAuth.authorize({
    responseType: "token id_token",
    //prompt: "none"
});

So i’m also confused :frowning:


#4