Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[source-linkedin-ads] LinkedIn Ads connector missing Refresh Token field with OAuth2.0 Authentication #52691

Open
1 task
robert-krasevec opened this issue Jan 31, 2025 · 5 comments

Comments

@robert-krasevec
Copy link

Connector Name

source-linkedin-ads

Connector Version

5.1.3

What step the error happened?

Configuring a new connector

Relevant information

Testing locally and running Airbyte using abctl tool I'm trying to set up a LinkedIn Ads source connector using OAuth2.0 Authentication method, but the field for Refresh Token is missing. The documentation also states that Refresh Token is required as input. Only possible way to test connector locally is using Access Token, which works, but Refresh Tokens live longer so it would be my preferred way.

Image
Image

Relevant log output

Contribute

  • Yes, I want to contribute
@natikgadzhi
Copy link
Contributor

This is a documentation problem ;-(

If you want to use Linkedin Ads with OAuth 2, you have to sign up for your own developer app with linkedin, fill out Client ID and Client Secret, and tap the authentication button. That's because on Airbyte OSS, we can't provide our own client_id and secret app tokens.

Previously, we did NOT allow you to do the OAuth2 flow, and we said that you should just provision your auth_token and refresh_token with whatever tools you want, and give us the tokens. Now we want client_id and client_secret instead.

cc @bnchrch, @Hesperide, @ian-at-airbyte.

If we see issues like this more often (this is 2nd time I see a user confused with new OAuth flow), we could:

  1. Make an automated cleanup of connector README and documentation files for connectors that have OAuth authenticators to explain the new flow.
  2. Make it possible for users to switch to legacy mode when they give us auth and refresh tokens without the client app creds.

@ian-at-airbyte
Copy link
Contributor

@natikgadzhi I've been inventorying connectors that might be affected by this. This was one of them. See: https://github.com/airbytehq/airbyte-internal-issues/issues/11477.

@robert-krasevec
Copy link
Author

As a follow-up, I also tried using only Client Id and Client Secret from LinkedIn Developer App also doesn't work. Might be an issue with redirect url? I used the one specified in info field and several different others combinations that might work, none did.

Image
Image

@natikgadzhi
Copy link
Contributor

natikgadzhi commented Feb 1, 2025 via email

@koenverhagen-sparkles-io

When trying to setup the Bing Ads connection, I get the same error.

2025-02-04 15:02:34,696 [io-executor-thread-6] INFO i.a.o.OAuthImplementationFactory(createNonDeclarativeOAuthImplementation):182 - Using MicrosoftBingAdsOAuthFlow for airbyte/source-bing-ads
2025-02-04 15:02:54,585 [io-executor-thread-8] INFO i.a.o.OAuthImplementationFactory(createNonDeclarativeOAuthImplementation):182 - Using MicrosoftBingAdsOAuthFlow for airbyte/source-bing-ads
2025-02-04 15:02:54,839 [io-executor-thread-10] INFO i.a.o.OAuthImplementationFactory(createNonDeclarativeOAuthImplementation):182 - Using MicrosoftBingAdsOAuthFlow for airbyte/source-bing-ads
2025-02-04 15:02:55,079 [io-executor-thread-10] ERROR i.a.c.s.e.h.UncaughtExceptionHandler(handle):33 - Uncaught exception
java.lang.RuntimeException: java.io.IOException: Missing 'refresh_token' in query params from https://login.microsoftonline.com/2cdd952c-71aa-4a6e-894b-367f1d582ae0/oauth2/v2.0/token
at io.airbyte.server.apis.ApiHelper.execute(ApiHelper.kt:43)
at io.airbyte.server.apis.SourceOauthApiController.completeSourceOAuth(SourceOauthApiController.java:44)
at io.airbyte.server.apis.$SourceOauthApiController$Definition$Exec.dispatch(Unknown Source)
at io.micronaut.context.AbstractExecutableMethodsDefinition$DispatchedExecutableMethod.invokeUnsafe(AbstractExecutableMethodsDefinition.java:461)
at io.micronaut.context.DefaultBeanContext$BeanContextUnsafeExecutionHandle.invokeUnsafe(DefaultBeanContext.java:4354)
at io.micronaut.web.router.AbstractRouteMatch.execute(AbstractRouteMatch.java:272)
at io.micronaut.web.router.DefaultUriRouteMatch.execute(DefaultUriRouteMatch.java:38)
at io.micronaut.http.server.RouteExecutor.executeRouteAndConvertBody(RouteExecutor.java:488)
at io.micronaut.http.server.RouteExecutor.lambda$callRoute$5(RouteExecutor.java:465)
at io.micronaut.core.execution.ExecutionFlow.lambda$async$1(ExecutionFlow.java:87)
at io.micronaut.core.propagation.PropagatedContext.lambda$wrap$3(PropagatedContext.java:211)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.io.IOException: Missing 'refresh_token' in query params from https://login.microsoftonline.com/2cdd952c-71aa-4a6e-894b-367f1d582ae0/oauth2/v2.0/token
at io.airbyte.oauth.BaseOAuth2Flow.extractOAuthOutput(BaseOAuth2Flow.java:599)
at io.airbyte.oauth.BaseOAuth2Flow.extractOAuthOutput(BaseOAuth2Flow.java:588)
at io.airbyte.oauth.BaseOAuth2Flow.getCompleteOAuthFlowOutput(BaseOAuth2Flow.java:458)
at io.airbyte.oauth.BaseOAuth2Flow.completeOAuthFlow(BaseOAuth2Flow.java:433)
at io.airbyte.oauth.BaseOAuth2Flow.completeSourceOAuth(BaseOAuth2Flow.java:277)
at io.airbyte.commons.server.handlers.OAuthHandler.completeSourceOAuth(OAuthHandler.java:332)
at io.airbyte.commons.server.handlers.OAuthHandler.completeSourceOAuthHandleReturnSecret(OAuthHandler.java:277)
at io.airbyte.server.apis.SourceOauthApiController.lambda$completeSourceOAuth$0(SourceOauthApiController.java:44)
at io.airbyte.server.apis.ApiHelper.execute(ApiHelper.kt:31)
... 13 common frames omitted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants