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

authentication error: http error: error issuing the request with reqwest: error sending request: JsValue(TypeError: Only absolute URLs are supported #105

Open
mesaque opened this issue Oct 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mesaque
Copy link

mesaque commented Oct 15, 2024

Scenario & Reproduction Steps

node v22.5.0

authentication error: http error: error issuing the request with reqwest: error sending request: JsValue(TypeError: Only absolute URLs are supported
TypeError: Only absolute URLs are supported
at getNodeRequestOptions (/Users/xxx/Documents/www/xxx/node_modules/node-fetch/lib/index.js:1327:9)
at /Users/xxx/Documents/www/xxx/node_modules/node-fetch/lib/index.js:1450:19
at new Promise ()
at fetch (/Users/xxx/Documents/www/xxx/node_modules/node-fetch/lib/index.js:1447:9)
at module.exports.__wbg_fetch_bc7c8e27076a5c84 (/Users/xxx/Documents/www/xxx/node_modules/@1password/sdk-core/nodejs/core.js:312:17)
at op_js_core.wasm.reqwest::wasm::client::js_fetch::ha27955dbb1f30d16 (wasm://wasm/op_js_core.wasm-014254e6:wasm-function[3158]:0x2e2f95)
at op_js_core.wasm.<op_reqwest_fetcher::ReqwestFetcher as op_http_fetcher::HttpFetcher>::request::{{closure}}::h3a181331326cc5ba (wasm://wasm/op_js_core.wasm-014254e6:wasm-function[107]:0x84076)
at op_js_core.wasm.<op_b5_client::UnauthenticatedSession as op_b5_client::Session>::request::{{closure}}::hff893f425ad048ce (wasm://wasm/op_js_core.wasm-014254e6:wasm-function[686]:0x1d2edd)
at op_js_core.wasm.op_service_account_authentication::lookup_auth::{{closure}}::hefde251e07cc903f (wasm://wasm/op_js_core.wasm-014254e6:wasm-function[221]:0x1029db)
at op_js_core.wasm.<op_service_account_authentication::ServiceAccountAuthenticator as op_b5_client::session_refresher::Authenticator>::new_unverified_session::{{closure}}::he3cc43e42663c1ac (wasm://wasm/op_js_core.wasm-014254e6:wasm-function[78]:0x3d794)
at op_js_core.wasm.<core::pin::Pin

as core::future::future::Future>::poll::h8866a0ab15d095a0 (wasm://wasm/op_js_core.wasm-014254e6:wasm-function[89]:0x5e474)
at op_js_core.wasm.wasm_bindgen_futures::future_to_promise::{{closure}}::{{closure}}::h8eb95870477ddaf6 (wasm://wasm/op_js_core.wasm-014254e6:wasm-function[484]:0x190a43)
at op_js_core.wasm.wasm_bindgen_futures::queue::Queue::new::{{closure}}::h40a7ee1c15b8d20a (wasm://wasm/op_js_core.wasm-014254e6:wasm-function[1431]:0x2572c1)
at op_js_core.wasm.<dyn core::ops::function::FnMut<(A,)>+Output = R as wasm_bindgen::closure::WasmClosure>::describe::invoke::h992c8f981e42a5a1 (wasm://wasm/op_js_core.wasm-014254e6:wasm-function[4791]:0x30ca09)
at __wbg_adapter_26 (/Users/xxx/Documents/www/xxx/node_modules/@1password/sdk-core/nodejs/core.js:219:10)
at real (/Users/xxx/Documents/www/xxx/node_modules/@1password/sdk-core/nodejs/core.js:204:20))

My Code:

let client = await sdk.createClient({
auth: process.env.OP_SERVICE_ACCOUNT_TOKEN,
// Set the following to your own integration name and version.
integrationName: "XXX",
integrationVersion: "v1.0.0",
});

Actual Behavior

i am running the current example on github page

Expected Behavior

conect

SDK version

@1password/[email protected]

Additional information

No response

@mesaque mesaque added the bug Something isn't working label Oct 15, 2024
@hculea
Copy link
Member

hculea commented Oct 23, 2024

Hey @mesaque , thank you for reporting!

That is unexpected - Is your service account token a valid one? You can check this with the 1Password CLI - exporting the token to the OP_SERVICE_ACCOUNT_TOKEN environment variable and running an op whoami command, after installing the CLI.

Additionally, you can check the formatting of your service account to see the actual URL that it makes requests for:

echo $OP_SERVICE_ACCOUNT_TOKEN | base64 -d

You should get back a JSON with a signInAddress field - is the value of that field expected? Is it prefixed with https:// or suffixed by anything after .com/.eu/.ca?

Let us know, happy to debug this further, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants