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

Support personal access token (PAT) in ConfluenceLoader #5191

Closed
EricSpeidel opened this issue May 24, 2023 · 3 comments · Fixed by #5385
Closed

Support personal access token (PAT) in ConfluenceLoader #5191

EricSpeidel opened this issue May 24, 2023 · 3 comments · Fixed by #5385

Comments

@EricSpeidel
Copy link
Contributor

EricSpeidel commented May 24, 2023

Issue you'd like to raise.

The Atlassian API (including Confluence) supports just passing a PAT (as token=) to authenticate as a user, unfortunately the LangChain abstraction doesn't.

Suggestion:

Add an optional "token" parameter to ConfluenceLoader and use it to authenticate within as an alternative to api_key/password/oauth.

@Jflick58
Copy link
Contributor

The confluence example in your documentation still uses the password kwarg:

confluence = Confluence(
    url='https://your-domain.atlassian.net',
    username=jira_username,
    password=jira_api_token,
    cloud=True)

Looking at the code for the Atlassian Python package, I do see that token is an implicit argument to the Confluence constructor inherited from the AtlassianRestAPI class.

@zywilliamli do you know anything about this? If we can resolve the conflict between the package documentation and the code, I'd be happy to add this token in. As it stands I tend to want to default to the documented behavior.

@felipeff
Copy link
Contributor

@Jflick58 The code snippet you provided is specific for using tokens in the cloud version, per the documentation.
For companies that use the on-prem Data Center/Server editions that doesn't work and we have to use only the "token" parameter.
This is documented on the original provided link.

I implemented the token argument on a personal fork so I could use the ConfluenceLoader on my confluence server/on-prem environment and confirm that this approach works and that using the username/password does not work.
For reference, this is a link to my fork: https://github.com/felipeff/langchain (I can update the documentation/tests and send a merge request and tag you for review if you want)

@Jflick58
Copy link
Contributor

@felipeff ah, good catch! 😀 An MR would be great.

hwchase17 pushed a commit that referenced this issue Jun 3, 2023
…nfluenceLoader (#5385)

# Implements support for Personal Access Token Authentication in the
ConfluenceLoader

Fixes #5191

Implements a new optional parameter for the ConfluenceLoader: `token`.
This allows the use of personal access authentication when using the
on-prem server version of Confluence.

## Who can review?

Community members can review the PR once tests pass. Tag
maintainers/contributors who might be interested:
@eyurtsev @Jflick58 

Twitter Handle: felipe_yyc

---------

Co-authored-by: Felipe <feferreira@ea.com>
Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
Undertone0809 pushed a commit to Undertone0809/langchain that referenced this issue Jun 19, 2023
…nfluenceLoader (langchain-ai#5385)

# Implements support for Personal Access Token Authentication in the
ConfluenceLoader

Fixes langchain-ai#5191

Implements a new optional parameter for the ConfluenceLoader: `token`.
This allows the use of personal access authentication when using the
on-prem server version of Confluence.

## Who can review?

Community members can review the PR once tests pass. Tag
maintainers/contributors who might be interested:
@eyurtsev @Jflick58 

Twitter Handle: felipe_yyc

---------

Co-authored-by: Felipe <feferreira@ea.com>
Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants