This repository has been archived on 2024-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
forgejo/modules/structs
M Hickford 191a74d622
Record OAuth client type at registration (#21316)
The OAuth spec [defines two types of
client](https://datatracker.ietf.org/doc/html/rfc6749#section-2.1),
confidential and public. Previously Gitea assumed all clients to be
confidential.

> OAuth defines two client types, based on their ability to authenticate
securely with the authorization server (i.e., ability to
>   maintain the confidentiality of their client credentials):
>
>   confidential
> Clients capable of maintaining the confidentiality of their
credentials (e.g., client implemented on a secure server with
> restricted access to the client credentials), or capable of secure
client authentication using other means.
>
>   **public
> Clients incapable of maintaining the confidentiality of their
credentials (e.g., clients executing on the device used by the resource
owner, such as an installed native application or a web browser-based
application), and incapable of secure client authentication via any
other means.**
>
> The client type designation is based on the authorization server's
definition of secure authentication and its acceptable exposure levels
of client credentials. The authorization server SHOULD NOT make
assumptions about the client type.

 https://datatracker.ietf.org/doc/html/rfc8252#section-8.4

> Authorization servers MUST record the client type in the client
registration details in order to identify and process requests
accordingly.

Require PKCE for public clients:
https://datatracker.ietf.org/doc/html/rfc8252#section-8.1

> Authorization servers SHOULD reject authorization requests from native
apps that don't use PKCE by returning an error message

Fixes #21299

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-10-24 15:59:24 +08:00
..
activitypub.go
admin_user.go
attachment.go
commit_status.go
cron.go
doc.go
fork.go
git_blob.go
git_hook.go
hook.go Display total commit count in hook message (#21400) 2022-10-17 00:22:34 +08:00
issue.go Support Issue forms and PR forms (#20987) 2022-09-02 15:58:49 +08:00
issue_comment.go
issue_label.go
issue_milestone.go
issue_reaction.go
issue_stopwatch.go
issue_tracked_time.go
lfs_lock.go
mirror.go Add new API endpoints for push mirrors management (#19841) 2022-07-30 18:45:59 +02:00
miscellaneous.go
nodeinfo.go
notifications.go
org.go Add name field for org api (#21270) 2022-09-29 05:27:33 +02:00
org_member.go
org_team.go Fix typo in API comment document (#21347) 2022-10-05 21:26:34 +01:00
org_type.go
package.go
pull.go Add API endpoint to get changed files of a PR (#21177) 2022-09-29 04:27:20 +02:00
pull_review.go Dismiss prior pull reviews if done via web in review dismiss (#20197) 2022-07-19 15:20:28 +02:00
release.go
repo.go Make external issue tracker regexp configurable via API (#21338) 2022-10-07 20:49:30 +08:00
repo_branch.go
repo_collaborator.go
repo_commit.go
repo_file.go Add latest commit's SHA to content response (#20398) 2022-07-30 16:09:04 +08:00
repo_key.go
repo_note.go
repo_refs.go
repo_tag.go
repo_topic.go
repo_tree.go
repo_watch.go
repo_wiki.go
settings.go
status.go
task.go
user.go Include login_name in adminCreateUser response (#20283) 2022-07-15 16:52:11 +08:00
user_app.go Record OAuth client type at registration (#21316) 2022-10-24 15:59:24 +08:00
user_email.go
user_gpgkey.go
user_key.go