AccessToken expired after an hour even though refresh token is in place – BigQuery Connector 1.0.9 in WSO2 EI 6.5.0

huangapple go评论72阅读模式
英文:

AccessToken expired after an hour even though refresh token is in place - BigQuery Connector 1.0.9 in WSO2 EI 6.5.0

问题

我正在使用BigQuery Connector V1.0.9来处理WSO2 EI 6.5.0中的DataSet、TableData等。

  • 生成了OAuth凭据,如ClientID,ClientSec,AccessToken,RefreshToken等。
  • 在WSO2 EI服务器中添加了连接器并启用了它。
  • 将所有上述提到的OAuth参数传递给bigquery.init操作以建立连接。
  • 在此init操作之后,在registry下创建了一些文件以存储AccessToken值。

bigquery.init - 代码:

<!-- 读取BigQuery凭据 -->
<sequence description="加载配置" key="Get_BigQuery_Credentials"/>
<!-- 建立BigQuery连接 -->
<bigquery.init>
    <apiUrl>{$ctx:apiUrl}</apiUrl>
    <accessToken>{$ctx:accessToken}</accessToken>
    <clientId>{$ctx:clientId}</clientId>
    <clientSecret>{$ctx:clientSecret}</clientSecret>
    <refreshToken>{$ctx:refreshToken}</refreshToken>
    <registryPath>{$ctx:registryPath}</registryPath>
</bigquery.init>
<log level="full"/>

WireLog:

[2023-03-09 17:11:57,785] []  INFO - LogMediator *********BigQueryAPI - OAuth = is called **********
[2023-03-09 17:11:57,788] []  INFO - DependencyTracker Local entry : Connector/BigQIntegwso2/ was added to the Synapse configuration successfully
[2023-03-09 17:11:58,248] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 << "GET /oauth2/v1/tokeninfo?access_token=ya29.XXXXXX HTTP/1.1[\r][\n]"
[2023-03-09 17:11:58,249] [] DEBUG - ...
...
[2023-03-09 17:11:58,740] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 << "Host: bigquery.googleapis.com[\r][\n]"
[2023-03-09 17:11:58,740] [] DEBUG - ...
...
[2023-03-09 17:11:58,899] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 >> "HTTP/1.1 404 Not Found[\r][\n]"
[2023-03-09 17:11:58,899] [] DEBUG - ...
...

以上是您提供的代码片段的翻译。

英文:

I am using BigQuery Connector V1.0.9 to work with DataSet,TableData etc in WSO2 EI 6.5.0.

  • Generated OAuth Credentials like ClientID,ClientSec,AccessToken,RefreshToken etc
  • Added Connector in WSO2 EI Server and enabled it
  • passed all above mentioned OAuth param to bigquery.init Operation to establish the connectivity.
  • After this init operation there is some file created under registry to store AccessToken Value

bigquery.init - Code:

&lt;!-- Reading BigQuery Credentials --&gt;
            &lt;sequence description=&quot;Load Configurations&quot; key=&quot;Get_BigQuery_Credentials&quot;/&gt;
            &lt;!-- Establish BigQuery Connectivity --&gt;
            &lt;bigquery.init&gt;
                &lt;apiUrl&gt;{$ctx:apiUrl}&lt;/apiUrl&gt;
                &lt;accessToken&gt;{$ctx:accessToken}&lt;/accessToken&gt;
                &lt;clientId&gt;{$ctx:clientId}&lt;/clientId&gt;
                &lt;clientSecret&gt;{$ctx:clientSecret}&lt;/clientSecret&gt;
                &lt;refreshToken&gt;{$ctx:refreshToken}&lt;/refreshToken&gt;
                &lt;registryPath&gt;{$ctx:registryPath}&lt;/registryPath&gt;
            &lt;/bigquery.init&gt;
            &lt;log level=&quot;full&quot;/&gt;

WireLog:

    [2023-03-09 17:11:57,785] []  INFO - LogMediator *********BigQueryAPI - OAuth = is called **********
[2023-03-09 17:11:57,788] []  INFO - DependencyTracker Local entry : Connector/BigQIntegwso2/ was added to the Synapse configuration successfully
[2023-03-09 17:11:58,248] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &lt;&lt; &quot;GET /oauth2/v1/tokeninfo?access_token=ya29.XXXXXX HTTP/1.1[\r][\n]&quot;
[2023-03-09 17:11:58,249] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &lt;&lt; &quot;activityid: 3404708f-5eb0-459d-ad1b-b376ddbc4059[\r][\n]&quot;[2023-03-09 17:11:58,249] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &lt;&lt; &quot;Accept: */*[\r][\n]&quot;
[2023-03-09 17:11:58,249] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &lt;&lt; &quot;Cache-Control: no-cache[\r][\n]&quot;
[2023-03-09 17:11:58,250] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &lt;&lt; &quot;Postman-Token: 238c81f0-ca8d-4577-912e-d30116589a73[\r][\n]&quot;
[2023-03-09 17:11:58,250] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &lt;&lt; &quot;Accept-Encoding: gzip, deflate, br[\r][\n]&quot;
[2023-03-09 17:11:58,250] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &lt;&lt; &quot;Content-Type: application/json[\r][\n]&quot;
[2023-03-09 17:11:58,250] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &lt;&lt; &quot;Host: www.googleapis.com[\r][\n]&quot;
[2023-03-09 17:11:58,250] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &lt;&lt; &quot;Connection: Keep-Alive[\r][\n]&quot;
[2023-03-09 17:11:58,250] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &lt;&lt; &quot;User-Agent: Synapse-PT-HttpComponents-NIO[\r][\n]&quot;
[2023-03-09 17:11:58,251] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &lt;&lt; &quot;[\r][\n]&quot;
[2023-03-09 17:11:58,355] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;HTTP/1.1 400 Bad Request[\r][\n]&quot;
[2023-03-09 17:11:58,355] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;Pragma: no-cache[\r][\n]&quot;
[2023-03-09 17:11:58,355] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;Date: Thu, 09 Mar 2023 11:41:57 GMT[\r][\n]&quot;
[2023-03-09 17:11:58,355] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;Expires: Mon, 01 Jan 1990 00:00:00 GMT[\r][\n]&quot;
[2023-03-09 17:11:58,356] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;Cache-Control: no-cache, no-store, max-age=0, must-revalidate[\r][\n]&quot;
[2023-03-09 17:11:58,356] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;Content-Type: application/json; charset=UTF-8[\r][\n]&quot;
[2023-03-09 17:11:58,356] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;Vary: Origin[\r][\n]&quot;
[2023-03-09 17:11:58,356] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;Vary: X-Origin[\r][\n]&quot;
[2023-03-09 17:11:58,356] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;Vary: Referer[\r][\n]&quot;
[2023-03-09 17:11:58,356] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;Content-Encoding: gzip[\r][\n]&quot;
[2023-03-09 17:11:58,357] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;Server: ESF[\r][\n]&quot;
[2023-03-09 17:11:58,357] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;X-XSS-Protection: 0[\r][\n]&quot;
[2023-03-09 17:11:58,357] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;X-Frame-Options: SAMEORIGIN[\r][\n]&quot;
[2023-03-09 17:11:58,357] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;X-Content-Type-Options: nosniff[\r][\n]&quot;
[2023-03-09 17:11:58,357] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;Alt-Svc: h3=&quot;:443&quot;; ma=2592000,h3-29=&quot;:443&quot;; ma=2592000[\r][\n]&quot;
[2023-03-09 17:11:58,357] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;Transfer-Encoding: chunked[\r][\n]&quot;
[2023-03-09 17:11:58,357] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;[\r][\n]&quot;
[2023-03-09 17:11:58,358] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,358] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;[0x1f][\r][\n]&quot;
[2023-03-09 17:11:58,358] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,358] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;[0x8b][\r][\n]&quot;
[2023-03-09 17:11:58,358] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,358] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;[0x8][\r][\n]&quot;
[2023-03-09 17:11:58,359] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,359] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;[0x0][\r][\n]&quot;
[2023-03-09 17:11:58,359] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,360] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;[0x0][\r][\n]&quot;
[2023-03-09 17:11:58,360] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,360] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;[0x0][\r][\n]&quot;
[2023-03-09 17:11:58,360] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,361] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;[0x0][\r][\n]&quot;
[2023-03-09 17:11:58,361] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,361] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;[0x0][\r][\n]&quot;
[2023-03-09 17:11:58,361] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,361] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;[0x2][\r][\n]&quot;
[2023-03-09 17:11:58,361] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,362] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;[0xff][\r][\n]&quot;
[2023-03-09 17:11:58,362] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,362] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;[0xab][\r][\n]&quot;
[2023-03-09 17:11:58,362] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,362] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;[0xe6][\r][\n]&quot;
[2023-03-09 17:11:58,362] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,362] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;R[\r][\n]&quot;
[2023-03-09 17:11:58,363] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,363] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;P[\r][\n]&quot;
[2023-03-09 17:11:58,363] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,364] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;P[\r][\n]&quot;
[2023-03-09 17:11:58,364] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,364] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;J[\r][\n]&quot;
[2023-03-09 17:11:58,364] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;00000001[\r][\n]&quot;
[2023-03-09 17:11:58,364] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;-[\r][\n]&quot;
[2023-03-09 17:11:58,365] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;0000001[\r][\n]&quot;
[2023-03-09 17:11:58,365] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;*[\r][\n]&quot;
[2023-03-09 17:11:58,365] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;3c[\r][\n]&quot;
[2023-03-09 17:11:58,365] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;[0xca]/R[0xb2]RP[0xca][0xcc]+K[0xcc][0xc9]L[0x89]/[0xc9][0xcf]N[0xcd]S[0xd2][0x81][0xcb][0xc5][0xa7][0xa4][0x16]&#39;[0x17]e[0x16][0x94]d[0xe6][0xe7][0x81][0xd4]yB[0xd4])[0x84]%[0xe6][0x94][0xa6]*q[0xd5]r[0x1][0x0][0x92]_[0xb][0xd2]G[0x0][0x0][0x0][\r][\n]&quot;
[2023-03-09 17:11:58,365] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;0[\r][\n]&quot;
[2023-03-09 17:11:58,366] [] DEBUG - wire HTTPS-Sender I/O dispatcher-6 &gt;&gt; &quot;[\r][\n]&quot;
[2023-03-09 17:11:58,737] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;POST /oauth2/v3/token HTTP/1.1[\r][\n]&quot;
[2023-03-09 17:11:58,738] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;X-Frame-Options: SAMEORIGIN[\r][\n]&quot;
[2023-03-09 17:11:58,738] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;Alt-Svc: h3=&quot;:443&quot;; ma=2592000,h3-29=&quot;:443&quot;; ma=2592000[\r][\n]&quot;
[2023-03-09 17:11:58,738] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;Cache-Control: no-cache, no-store, max-age=0, must-revalidate[\r][\n]&quot;
[2023-03-09 17:11:58,738] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;X-Content-Type-Options: nosniff[\r][\n]&quot;
[2023-03-09 17:11:58,738] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;Content-Encoding: gzip[\r][\n]&quot;
[2023-03-09 17:11:58,738] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;Vary: Origin[\r][\n]&quot;
[2023-03-09 17:11:58,739] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;Vary: X-Origin[\r][\n]&quot;
[2023-03-09 17:11:58,739] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;Vary: Referer[\r][\n]&quot;
[2023-03-09 17:11:58,739] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;Expires: Mon, 01 Jan 1990 00:00:00 GMT[\r][\n]&quot;
[2023-03-09 17:11:58,739] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;Pragma: no-cache[\r][\n]&quot;
[2023-03-09 17:11:58,739] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;X-XSS-Protection: 0[\r][\n]&quot;
[2023-03-09 17:11:58,740] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;Content-Type: application/x-www-form-urlencoded[\r][\n]&quot;
[2023-03-09 17:11:58,740] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;Transfer-Encoding: chunked[\r][\n]&quot;
[2023-03-09 17:11:58,740] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;Host: bigquery.googleapis.com[\r][\n]&quot;
[2023-03-09 17:11:58,740] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;Connection: Keep-Alive[\r][\n]&quot;
[2023-03-09 17:11:58,740] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;User-Agent: Synapse-PT-HttpComponents-NIO[\r][\n]&quot;
[2023-03-09 17:11:58,741] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;[\r][\n]&quot;
[2023-03-09 17:11:58,741] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;ff[\r][\n]&quot;
[2023-03-09 17:11:58,741] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;[0x1f][0x8b][0x8][0x0][0x0][0x0][0x0][0x0][0x0][0x0]M[0x8e][0xbb]n[0x83]0[0x0]E[0xbf][0xa6][0xd9]@$`[0x1e][0x3][0x3][0xb8][0x1][0xd2]B qS[0xc1][0x84][0xc0][0x18]b[0xa0][0xd8]1[0x8f][0x88]|}Y*U[0xba][0xdb][0xd1]9[0xba][0x82][0xd4][0x82][0x8c][0xf7]|b[0x1d][0x19][0xec][0xfd][0xdb][0xc1][0xdb][0xa6]TF[0x90][0xbc][0xb7]H[\r][0xca]+[0x82]Mvr[0xae][0x8e][0xe3];[\n]&quot;
[2023-03-09 17:11:58,741] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;:?=)[0xb4]Nb[0x8c].[0x91][0xb][0xe1][0xd7][0xfa][0xca]W&#39;E[0xd8][\r][0xc2]g[0xde][0xb9][0x91]0[0x88][0xee]~.C[0x1e]&#39;[0xad][0xc5][0xea]c[0xd1])[0x10][0x9a][0xe0][0xbe]f[0xe1][0x7][0xf7].[0x12][0x2][0xc9]7[0x4][0x98]GY[0xb3]kD1L[0xf9][0xb4]rb[0x8b][0xff]&#39;v[0xb8][0xa7]d##[0xc1][0x82]L[0xb6][0x1f]C[0x94][0xa4][0x92][0x1b][0xd3][0xe5][0xc6]5[0xea][0xd7]^Y=[0x8e]:[0xa2]Io[0xf0][0xdb]9K[0x15][0xfd][0xcf][0xa0][0x95][0xad][0xee][\r][0xd3][0x4][0xaa]u[0x0]@[0x93]*Pj3e[0x1d][0xc0][0x7][0xfe][0xd0]g[0xc1][0x16]R3[0xa0][0xf3]A[0xd1]Z[0xa0][0xea][0x86]\p&gt;[0xca][\r]cMO[0xe6][0x91][0x8][0xcc][0x86]i[0xeb][0xc8][0x98][0xfd][0xfc][0x2][0xc2][0xf9][0xbd][[0x17][0x1][0x0][0x0][\r][\n]&quot;
[2023-03-09 17:11:58,741] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;0[\r][\n]&quot;
[2023-03-09 17:11:58,741] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &lt;&lt; &quot;[\r][\n]&quot;
[2023-03-09 17:11:58,898] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;HTTP/1.1 404 Not Found[\r][\n]&quot;
[2023-03-09 17:11:58,898] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;Content-Type: text/html; charset=UTF-8[\r][\n]&quot;
[2023-03-09 17:11:58,899] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;Referrer-Policy: no-referrer[\r][\n]&quot;
[2023-03-09 17:11:58,899] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;Content-Length: 1576[\r][\n]&quot;
[2023-03-09 17:11:58,899] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;Date: Thu, 09 Mar 2023 11:41:58 GMT[\r][\n]&quot;
[2023-03-09 17:11:58,899] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;Alt-Svc: h3=&quot;:443&quot;; ma=2592000,h3-29=&quot;:443&quot;; ma=2592000[\r][\n]&quot;
[2023-03-09 17:11:58,899] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;Connection: close[\r][\n]&quot;
[2023-03-09 17:11:58,900] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;[\r][\n]&quot;
[2023-03-09 17:11:58,900] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;&lt;!DOCTYPE html&gt;[\n]&quot;
[2023-03-09 17:11:58,900] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;&lt;html lang=en&gt;[\n]&quot;
[2023-03-09 17:11:58,900] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;  &lt;meta charset=utf-8&gt;[\n]&quot;
[2023-03-09 17:11:58,900] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;  &lt;meta name=viewport content=&quot;initial-scale=1, minimum-scale=1, width=device-width&quot;&gt;[\n]&quot;
[2023-03-09 17:11:58,900] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;  &lt;title&gt;Error 404 (Not Found)!!1&lt;/title&gt;[\n]&quot;
[2023-03-09 17:11:58,901] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;  &lt;style&gt;[\n]&quot;
[2023-03-09 17:11:58,901] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* &gt; body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min&quot;
[2023-03-09 17:11:58,902] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}[\n]&quot;
[2023-03-09 17:11:58,906] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;  &lt;/style&gt;[\n]&quot;
[2023-03-09 17:11:58,906] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;  &lt;a href=//www.google.com/&gt;&lt;span id=logo aria-label=Google&gt;&lt;/span&gt;&lt;/a&gt;[\n]&quot;
[2023-03-09 17:11:58,907] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;  &lt;p&gt;&lt;b&gt;404.&lt;/b&gt; &lt;ins&gt;That[0xe2][0x80][0x99]s an error.&lt;/ins&gt;[\n]&quot;
[2023-03-09 17:11:58,907] [] DEBUG - wire HTTPS-Sender I/O dispatcher-7 &gt;&gt; &quot;  &lt;p&gt;The requested URL &lt;code&gt;/oauth2/v3/token&lt;/code&gt; was not found on this server.  &lt;ins&gt;That[0xe2][0x80][0x99]s all we know.&lt;/ins&gt;[\n]&quot;
[2023-03-09 17:11:58,908] [] ERROR - RelayUtils Error while building Passthrough stream
org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: DOCTYPE is not allowed
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
at org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:109)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:570)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:566)
at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:165)
at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:168)
at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:121)
at org.apache.synapse.mediators.AbstractListMediator.buildMessage(AbstractListMediator.java:146)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:95)
at org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMediator.java:171)
at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:242)
at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:242)
at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:242)
at org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMediator.java:179)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:267)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:805)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:303)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:578)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:195)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:265)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.xml.stream.XMLStreamException: DOCTYPE is not allowed
at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:36)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
... 24 more
[2023-03-09 17:11:58,916] [] ERROR - TemplateMediator Error while building message. Error while building Passthrough stream
org.apache.axis2.AxisFault: Error while building Passthrough stream
  • After an hour Oauth Accesstoken Expired and noticed HTTP/1.1 400 Bad Request ERROR in above shared Wirelog.
  • Even though we're passing refreshToken in init Operation, why that accesstoken expired? The main purpose of refresh token is to refresh/regenerate the access token when it expires to make it alive. Correct me if i'm wrong.

I need to manually generate credentials again and update in WSO2 API also. How can we avoid this situation?

PS: Worked with Gmail/Outlook Connector where simlar set of token param are used , this kinda ERROR not happened frequently. But with BigQuery Connector expired every an hour.

Kindly suggest some better way to handle this situation?

答案1

得分: 1

Your token endpoint seems Wrong. Shouldn't it be https://www.googleapis.com/oauth2/v4/token So change your apiUrl to https://www.googleapis.com.

Following is a sample dataset.

{
  "accessToken": "ya29.BwKYx40Dith1DFQBDjZOHNqhcxmKs9zbkjAWQa1q8mdMFndp2-q8ifG66fwprOigRwKSNw",
  "apiUrl": "https://www.googleapis.com",
  "clientId": "504627865627-kdni8r2s10sjddfgXzqb4bvnba.apps.googleusercontent.com",
  "clientSecret": "ChlbHI_T7zssXXTRYuqj_-TM",
  "refreshToken": "1/uWful-diQNAdk-alDUa6ixxxxxxxx-LpJIikEQ2sqA",
  "registryPath": "connectors/bq",
  "projectId": "publicdata",
  "datasetId": "samples",
  "fields": "id",
  "callback": "callBackFunction",
  "apiKey": "154987fd5h4x6gh4",
  "prettyPrint": "true",
  "quotaUser": "1hx46f5g4h5ghx6h41x54gh6f4hx",
  "userIp": "192.77.88.12",
  "ifNoneMatch":"hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8",
  "ifMatch":"hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8"
}

Take a look at this document as well.

英文:

Your token endpoint seems Wrong. Shouldn't it be https://www.googleapis.com/oauth2/v4/token So change your apiUrl to https://www.googleapis.com.

Following is a sample dataset.

{
  &quot;accessToken&quot;: &quot;ya29.BwKYx40Dith1DFQBDjZOHNqhcxmKs9zbkjAWQa1q8mdMFndp2-q8ifG66fwprOigRwKSNw&quot;,
  &quot;apiUrl&quot;: &quot;https://www.googleapis.com&quot;,
  &quot;clientId&quot;: &quot;504627865627-kdni8r2s10sjddfgXzqb4bvnba.apps.googleusercontent.com&quot;,
  &quot;clientSecret&quot;: &quot;ChlbHI_T7zssXXTRYuqj_-TM&quot;,
  &quot;refreshToken&quot;: &quot;1/uWful-diQNAdk-alDUa6ixxxxxxxx-LpJIikEQ2sqA&quot;,
  &quot;registryPath&quot;: &quot;connectors/bq&quot;,
  &quot;projectId&quot;: &quot;publicdata&quot;,
  &quot;datasetId&quot;: &quot;samples&quot;,
  &quot;fields&quot;: &quot;id&quot;,
  &quot;callback&quot;: &quot;callBackFunction&quot;,
  &quot;apiKey&quot;: &quot;154987fd5h4x6gh4&quot;,
  &quot;prettyPrint&quot;: &quot;true&quot;,
  &quot;quotaUser&quot;: &quot;1hx46f5g4h5ghx6h41x54gh6f4hx&quot;,
  &quot;userIp&quot;: &quot;192.77.88.12&quot;,
  &quot;ifNoneMatch&quot;:&quot;hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8&quot;,
  &quot;ifMatch&quot;:&quot;hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8&quot;
}

Take a look at this document as well.

huangapple
  • 本文由 发表于 2023年3月9日 19:20:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/75683900.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定