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

[Bug] "Disable sign-in" also disables API requests using existing token #12985

Closed
2 of 7 tasks
KaKi87 opened this issue Sep 30, 2020 · 4 comments
Closed
2 of 7 tasks

[Bug] "Disable sign-in" also disables API requests using existing token #12985

KaKi87 opened this issue Sep 30, 2020 · 4 comments
Labels
modifies/api This PR adds API routes or modifies them

Comments

@KaKi87
Copy link

KaKi87 commented Sep 30, 2020

  • Gitea version (or commit ref): 1.12.4
  • Git version: 2.20.1
  • Operating system: Debian 10
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

Disable sign-in is an option that prevents login attempts to an account.
But this option, when enabled, also blocks API requests.
Considering that an API call is made with a token that have been previously generated, then it's technically not a login action.
Therefore, I'm asking for API calls to be allowed when this option is enabled.

My use case : I needed a bot account for a project that generates Gitea issues from Sentry SDKs.
So, I created a user account with a random 64 all-type characters password that I only used once and din't saved, in order to generate an API token that I saved in one place : the project's configuration file.
Then I'd like to disable login on the account so that no one gets tempted to try cracking it.

Although I didn't tried it, I think that if enabling Disable sign-in also blocks previously created and non-expired session tokens, this blocking should also be removed.

The right solution, that actually exists, to implement these behaviors, is disabling the account by unchecking the User Account Is Activated option.

Screenshots

When Disable sign-in is enabled :

image

When Disable sign-in is disabled :

image

Thanks !

@6543 6543 added the modifies/api This PR adds API routes or modifies them label Sep 30, 2020
@lunny
Copy link
Member

lunny commented Oct 1, 2020

It's by design. Disable or not, it's a problem. Maybe we need a new option named Disable API.

@KaKi87
Copy link
Author

KaKi87 commented Oct 1, 2020

I don't understand how is an API request a login action ?

@zeripath
Copy link
Contributor

zeripath commented Oct 1, 2020

Using a token is a login action - with a token you can do almost anything that you can do with a password.

What you mean is that you want to disable non-token authentication.

@KaKi87
Copy link
Author

KaKi87 commented Oct 1, 2020

Using a token is a login action

How so ?
Isn't generating the token a login action ?

@KaKi87 KaKi87 closed this as completed Feb 20, 2022
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them
Projects
None yet
Development

No branches or pull requests

4 participants