# Always same auth token (config seafile with 2FA)

**URL:** <https://forum.rclone.org/t/always-same-auth-token-config-seafile-with-2fa/26683>\
**Category:** Help and Support\
**Created:** [September 24, 2021, 4:25am UTC](https://forum.rclone.org/t/always-same-auth-token-config-seafile-with-2fa/26683 "2021-09-24T04:25:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mo-han](https://forum.rclone.org/user_avatar/forum.rclone.org/mo-han/32/10349_2.png) [@mo-han](https://forum.rclone.org/u/mo-han)\
**Post date:** [September 24, 2021, 4:25am UTC](https://forum.rclone.org/t/always-same-auth-token-config-seafile-with-2fa/26683/1 "2021-09-24T04:25:39Z")

</div>

#### What is the problem you are having with rclone?

when doing config of a seafile remote with 2FA, the token is always the same one.  
i don't blame rclone because according to the seafile official API docs, i get the exactly same token with a POST to the /api2/auth-token.  
so rclone is doing the "right" thing according to the doc, but still, something is wrong.

what rclone does (also the same with a POST request according to seafile API docs):

- get a unique token, same one everytime (2FA enabled).
- can always access with this token.
- this token doesn't show up on the seafile web page (/linked-devices/), which is reasonable, since a special unique never-changed token is not possible to represent a specific device.

while the official clients, both "seafile client" and "seadrive", they behave differently:

- everytime re-login, the token is different (same user, same password).
- this token is on the list of `/linked-devices/`, representing the device that has gotten this token.
- if user manually delete / disconnect this device / token, then this token is expired.
- (these two client apps store auth tokens into a sqlite3 db file in plaintext after user logi)

a unique, always same, never expired auth token is a critical security hole. users even cannot delete it manually. although seafile has done this and documented it officially, we should not use it.

#### What is your rclone version (output from `rclone version`)

```auto
rclone v1.56.0
- os/version: ubuntu 18.04 (64 bit)
- os/kernel: 5.4.0-42-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.16.5
- go/linking: static
- go/tags: none

```

#### Which cloud storage system are you using? (eg Google Drive)

Seafile CE v8.0.7

#### The command you were trying to run (eg `rclone copy /tmp remote:tmp`)

```auto
Paste command here

```

#### The rclone config contents with secrets removed.

```auto
Paste config here

```

#### A log from the command with the `-vv` flag

```auto
Paste log here

```

---

<div class="post-metadata">

**Author:** ![Ole](https://forum.rclone.org/user_avatar/forum.rclone.org/ole/32/9242_2.png) [@Ole](https://forum.rclone.org/u/Ole)\
**Post date:** [September 24, 2021, 6:41am UTC](https://forum.rclone.org/t/always-same-auth-token-config-seafile-with-2fa/26683/2 "2021-09-24T06:41:58Z")

</div>

Hi mo-han,

I would appreciate a little feedback on my answer to [your previous post](https://forum.rclone.org/t/sync-between-two-remote-with-different-tpslimit/26634), was it helpful?  
(Select as solution, send a heart, a brief comment - anything but silence)

It looks like you also have other rclone community members awaiting feedback too.

Thanks, Ole

---

<div class="post-metadata">

**Author:** ![creativeprojects](https://forum.rclone.org/user_avatar/forum.rclone.org/creativeprojects/32/5983_2.png) [@creativeprojects](https://forum.rclone.org/u/creativeprojects)\
**Post date:** [September 24, 2021, 10:42pm UTC](https://forum.rclone.org/t/always-same-auth-token-config-seafile-with-2fa/26683/3 "2021-09-24T22:42:36Z")

</div>

I can confirm, from all my tests when I was working on the Seafile backend, that the authorisation token returned is always the same per user. That certainly bothered me as well, but there was no other option.

After the backend was finalised, Seafile version 7.1 introduced the API token concept, which would indeed solve the problem.

I had a quick look at the new APIs, and we need to call new endpoints which are different from the standard endpoints (which are also different from the undocumented API used by the official client. Yes there's a strong lack of consistency in the API).

So actually, there's some non-trivial work involved to make the backend compatible with the two authentication systems. I'll probably work on it at some point, but in the meantime you're welcome to propose a PR 😄

[https://download.seafile.com/published/web-api/v2.1/library-api-tokens.md](https://download.seafile.com/published/web-api/v2.1/library-api-tokens.md)

---

<div class="post-metadata">

**Author:** ![mo-han](https://forum.rclone.org/user_avatar/forum.rclone.org/mo-han/32/10349_2.png) [@mo-han](https://forum.rclone.org/u/mo-han)\
**Post date:** [September 25, 2021, 3:43am UTC](https://forum.rclone.org/t/always-same-auth-token-config-seafile-with-2fa/26683/4 "2021-09-25T03:43:33Z")

</div>

thank you for your hard work.

this "new" lib-token is definitely something demanded, but it's not urge and you can just take it easy.  
rclone can just use the token extract from official client app's SQLite db file to access seafile access, which is my practice. it's not hard, the software called "sqlitebrowser" can be used to view those ".db" files.

as for now, the only necessary thing is to put a warning in the doc of rclone's seafile part to let users know the security issue.

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [October 25, 2021, 3:44am UTC](https://forum.rclone.org/t/always-same-auth-token-config-seafile-with-2fa/26683/5 "2021-10-25T03:44:03Z")

</div>

Closed on October 25, 2021, 3:44am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
