Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Impersonation Throws a "Bad Request" at Me Now

Not long ago, I was able to generate a token for the report embed with the following parameters:     This allowed me to use the user to filter the report based on the row-level security sett...
  • Eric_Zhang's avatar
    8 years ago

    Anonymous wrote:

    Not long ago, I was able to generate a token for the report embed with the following parameters:

     

     

    This allowed me to use the user to filter the report based on the row-level security settings. For some reason, today this now throws a "Bad Request" endpoint error at me.

     

    The odd thing is that the request goes through just fine if I omit the impersonation. It works just fine if I simplify the code to:

    var generateTokenRequestParameters = new GenerateTokenRequest(accessLevel: "view");

    However, this obviously doesn't help me with my row-level security issue.

     

    Is anyone aware of any recent endpoint changes for spoofing an identity? Am I missing some information on the EffectiveIdentity instance?

     


    Anonymous

    It actually works in my test. The reason for bad request might be RLS is not applied for that dataset, the datasetId is incorrect for the embedding report etc.

     

    In your case, I'd suggest you test calling the API GenerateToken in Postman or add try..catch block in your code to get the specific error message from the bad request.

    try
                    {
                        generatetoken()
                    }
    catch (HttpOperationException ex)
                   { 
                        //Bad Request
                        var content = ex.Response.Content;
                        Console.WriteLine(content); 
                    }