Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
alexbjorlig
Helper IV
Helper IV

When developing a custom data connector for a GraphQL API, are there any oAuth examples?

I'm trying to develop a custom data connector that accesses a GraphQl API, using oAuth.

 

The first time it works great, I get a token and query data!

 

But when the token expires, the API responds with the following payload: 

 

 

 

{
  "errors": [
    {
      "name": "GraphQLError",
      "message": "No valid session could be found, please reauthenticate",
      "path": [
        "roles"
      ],
      "code": "token-invalid",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ]
    }
  ],
  "data": null
}

 

 

 

And then nothing works - the refresh token apparently not being used.

 

How can I tell the extensions oAuth package that it should retrive a new access_token?

 

Thanks in advance, 

 

/Alex

 

Update 

 

In the end I gave up and changed the GraphQl API to return statusCode 401 --> now it works.

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @alexbjorlig ,

Is there anything else need to help with regarding this thread? If no, could you please mark your post as Answered? It will help the others in the community find the solution easily when they face the same problem with you. Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yiruan-msft
Community Support
Community Support

Hi @alexbjorlig ,

Is there anything else need to help with regarding this thread? If no, could you please mark your post as Answered? It will help the others in the community find the solution easily when they face the same problem with you. Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Where do I mark is as Answered?

Hi @alexbjorlig ,

You can click the button "Accept as Solution" under the helpful post to mark it as Answered.

yingyinr_0-1619488732877.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.