Skip to main content
Announcements
Global Transformation Awards submissions are open! SUBMIT YOUR STORY
cancel
Showing results for 
Search instead for 
Did you mean: 
nicefella
Contributor
Contributor

How can i fetch a csrf token with an access token?

Hi,

I have integrated an OAuth2 flow on my Qlik Sense Business tenant and I can successfully retrieve an access_token.

But I can't make it work when sending this token in Authorization Bearer header to get a csrf token which I aim to use it in my websocket connection later.

const response = await fetch(
    'https://mytenant.eu.qlikcloud.com/api/v1/csrf-token',
    {
      method: 'GET',
      credentials: 'include',
      headers: {
        Authorization: `Bearer ${accessToken}`,
      },
    },
  );

 

It simply returns a 404 Not Found.

But I can use this very same token to fetch current user in

and it successfully gives me my user info.

What am I doing wrong? Or, is this  an unsupported feature?

I also tried to include  qlik-web-integration-id in my request header but no success either.

 

 

 

Labels (3)
1 Solution

Accepted Solutions
Damien_V
Support
Support

The error is misleading but basically the csrf-token endpoint does not support that authentication type, it's only meant for authentication through an interactive Identity Provider.

If the issue is solved please mark the answer with Accept as Solution.

View solution in original post

2 Replies
Damien_V
Support
Support

The error is misleading but basically the csrf-token endpoint does not support that authentication type, it's only meant for authentication through an interactive Identity Provider.

If the issue is solved please mark the answer with Accept as Solution.
ashish_banjare
Contributor
Contributor

Hello Team,
Same error i am facing,

Error : CSRF token not supported for given authentication type. 400 Bad request.

I have Client Credentials access token in Qlik Saas Business Portal Where i can not configure Identity provider. how can we solve it,

Thanks