Skip to content

Comments

feat: add config setting "bearerTokenGetFunction"#397

Open
vera wants to merge 2 commits intoIQSS:developfrom
vera:feat/get-custom-bearer-token
Open

feat: add config setting "bearerTokenGetFunction"#397
vera wants to merge 2 commits intoIQSS:developfrom
vera:feat/get-custom-bearer-token

Conversation

@vera
Copy link

@vera vera commented Nov 4, 2025

What this PR does / why we need it:

This PR adds a config setting bearerTokenGetFunction to define a custom function to retrieve the bearer token. This is more flexible than the current bearerTokenLocalStorageKey setting.

Which issue(s) this PR closes:

Related Dataverse PRs:

/

Special notes for your reviewer:

/

Suggestions on how to test this:

I've tested this by initializing with the following config:

ApiConfig.init(
  "http://localhost:8080/api",
  DataverseApiAuthMechanism.BEARER_TOKEN,
  undefined,
  undefined,
  () => {
    const value = localStorage.getItem("oidc.default");
    if (value) {
      const token = JSON.parse(value).tokens?.accessToken;
      return token || null;
    } else {
      return null;
    }
  }
);

and confirmed that bearer-token-authenticated requests are correctly sent.

Is there a release notes or changelog update needed for this change?:

Yes, that would be good.

Additional documentation:

/

@pdurbin pdurbin moved this to Ready for Triage in IQSS Dataverse Project Nov 4, 2025
@scolapasta scolapasta moved this from Ready for Triage to Ready for Review ⏩ in IQSS Dataverse Project Nov 12, 2025
@cmbz cmbz added FY26 Sprint 10 FY26 Sprint 10 (2025-11-05 - 2025-11-19) FY26 Sprint 11 FY26 Sprint 11 (2025-11-20 - 2025-12-03) labels Nov 20, 2025
@cmbz cmbz added the FY26 Sprint 12 FY26 Sprint 12 (2025-12-03 - 2025-12-17) label Dec 3, 2025
@cmbz cmbz added the FY26 Sprint 13 FY26 Sprint 13 (2025-12-17 - 2025-12-31) label Dec 17, 2025
@cmbz cmbz added the FY26 Sprint 14 FY26 Sprint 14 (2025-12-31 - 2026-01-14) label Dec 31, 2025
@pdurbin pdurbin added the Size: 3 A percentage of a sprint. 2.1 hours. label Jan 7, 2026
@cmbz cmbz added the FY26 Sprint 15 FY26 Sprint 15 (2026-01-14 - 2026-01-28) label Jan 15, 2026
@cmbz cmbz added the FY26 Sprint 16 FY26 Sprint 16 (2026-01-28 - 2026-02-11) label Jan 29, 2026
@cmbz cmbz added the FY26 Sprint 17 FY26 Sprint 17 (2026-02-11 - 2026-02-25) label Feb 11, 2026
@ekraffmiller ekraffmiller moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Feb 12, 2026
@ekraffmiller ekraffmiller self-assigned this Feb 12, 2026
Copy link
Contributor

@ekraffmiller ekraffmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Vera, this looks good, I just suggested a small change in the init() function.

Co-authored-by: Ellen Kraffmiller <ekraffmiller@g.harvard.edu>
@vera
Copy link
Author

vera commented Feb 17, 2026

Thanks, I accepted the suggestion!

Copy link
Contributor

@ekraffmiller ekraffmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, approved!

@github-project-automation github-project-automation bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 10 FY26 Sprint 10 (2025-11-05 - 2025-11-19) FY26 Sprint 11 FY26 Sprint 11 (2025-11-20 - 2025-12-03) FY26 Sprint 12 FY26 Sprint 12 (2025-12-03 - 2025-12-17) FY26 Sprint 13 FY26 Sprint 13 (2025-12-17 - 2025-12-31) FY26 Sprint 14 FY26 Sprint 14 (2025-12-31 - 2026-01-14) FY26 Sprint 15 FY26 Sprint 15 (2026-01-14 - 2026-01-28) FY26 Sprint 16 FY26 Sprint 16 (2026-01-28 - 2026-02-11) FY26 Sprint 17 FY26 Sprint 17 (2026-02-11 - 2026-02-25) Size: 3 A percentage of a sprint. 2.1 hours.

Projects

Status: Ready for QA ⏩

Development

Successfully merging this pull request may close these issues.

Feature request: custom config for retrieving bearer token

4 participants