OAuth2 - Not Automatically Authenticating

Hi,

I've successfully managed to configure a REST resource with OAuth2... first stage complete :slight_smile:

However, I've run into an issue when using the resource on an app...

When I add the resource query and get some data from an endpoint in the editor, it works fine because I can click the "re-authenticate" button and get prompted to allow login.

However, when I send the link to the app for another user to run, it is not asking them to login and I can see that it has not authenticated the user via OAuth yet. It also doesn't prompt the user to authenticate.

Am I misunderstanding or missing a step somewhere here? Is there some trigger action which should fire when the user first launches the app that prompts them to authenticate?

Screenshots below (sorry, i dont have a shot of the app when the user is not authenticated but essentially the auth_status will be "not authenticated")...

OAuth2 Setup:

App (when run in editor and authenticated):

Have resolved this with the help of support.

Was caught out by the 200 response which was given back by the "supposedly" authenticated endpoint. Because of this the resource connection thought I was already authenticated.

I found an alternative endpoint to check against, this time one which returned a 401 (Unauthorized) if not autnenticated - this forced the connection prompt and we were golden.

Was also made aware of the "Auth" button component, which allows you to force an authentication against a query resource - a useful way of testing by manually getting the user to auth using the button.

Good learning exercise for me! Thanks again to support. :+1:

1 Like

Thanks for this follow up, @dcsearle! :blush: