CLI misses the Tenant flag for the authentication source Azure AD v2 (OAuth2) #10197

Closed
opened 2025-11-02 09:00:49 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @Adito5393 on GitHub (Feb 1, 2023).

Originally assigned to: @Adito5393 on GitHub.

Description

The configuration of the Azure AD v2 source via the webpage works as expected:
image

However, via the CLI, there is no way to pass the tenant value. I can see the CustomURLMapping structure contains the Tenant value.

I can work on a PR if someone can indeed confirm that the following files need the updates:

Gitea Version

1.18.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.36.4, Wire Protocol Version 2 Enabled

Operating System

Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-1026-kvm x86_64)

How are you running Gitea?

Running it in Docker version 20.10.23 from docker image gitea/gitea:1.18.2-rootless.

Database

PostgreSQL

Originally created by @Adito5393 on GitHub (Feb 1, 2023). Originally assigned to: @Adito5393 on GitHub. ### Description The configuration of the Azure AD v2 source via the webpage works as expected: ![image](https://user-images.githubusercontent.com/39572144/216041786-3a177fde-b0ab-406d-86d0-360b8ac8236e.png) However, via the CLI, there is no way to pass the tenant value. I can see the [CustomURLMapping](https://github.com/go-gitea/gitea/blob/main/services/auth/source/oauth2/urlmapping.go) structure contains the `Tenant` value. I can work on a PR if someone can indeed confirm that the following files need the updates: - Add another line: `TenantID: c.String("custom-tenant-id"),` to the [cmd/admin.go](https://github.com/go-gitea/gitea/blob/477a1cc40ebd3ecb116c632b0717bba748e914d2/cmd/admin.go#L813) - add another CLI option for [cmd/admin.go](https://github.com/go-gitea/gitea/blob/477a1cc40ebd3ecb116c632b0717bba748e914d2/cmd/admin.go#L927) - Do I need to edit the [providers_custom.go](https://github.com/go-gitea/gitea/blob/72a83dcc82add7537d2f661aa929dd073ced65f3/services/auth/source/oauth2/providers_custom.go#L109)? Replace `organizations` with something else? - Update the [CLI docs](https://docs.gitea.io/en-us/command-line/#admin) ([source md](https://github.com/go-gitea/gitea/blob/main/docs/content/doc/usage/command-line.en-us.md)) ### Gitea Version 1.18.2 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version 2.36.4, Wire Protocol Version 2 Enabled ### Operating System Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-1026-kvm x86_64) ### How are you running Gitea? Running it in Docker version 20.10.23 from docker image `gitea/gitea:1.18.2-rootless`. ### Database PostgreSQL
GiteaMirror added the type/bug label 2025-11-02 09:00:49 -06:00
Author
Owner

@zeripath commented on GitHub (Feb 1, 2023):

You shouldn't need to edit providers_custom.go.

Just update the cmds and the docs.

@zeripath commented on GitHub (Feb 1, 2023): You shouldn't need to edit providers_custom.go. Just update the cmds and the docs.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10197