Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit d3fc2d2

Browse files
authored
docs(jfrog-oauth): improve docs (#129)
* docs(jfrog-oauth): improve docs Adds additional step and screenshot to show creating an OAuth app in JFrog platform * Update README.md * Add files via upload * fmt * move JFrog Artifactory integration setup instructions * Update JFrog token documentation
1 parent 38a2d86 commit d3fc2d2

File tree

2 files changed

+10
-61
lines changed

2 files changed

+10
-61
lines changed

jfrog-oauth/README.md

Lines changed: 9 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,16 @@ tags: [integration, jfrog]
1010

1111
# JFrog
1212

13-
Install the JF CLI and authenticate package managers with Artifactory using OAuth configured via the Coder `external-auth` feature.
13+
Install the JF CLI and authenticate package managers with Artifactory using OAuth configured via the Coder [`external-auth`](https://coder.com/docs/v2/latest/admin/external-auth) feature.
1414

15-
<p align="center">
16-
<img src='../.images/jfrog-oauth.png' alt="JFrog OAuth" width='600'>
17-
</p>
15+
![JFrog OAuth](../.images/jfrog-oauth.png)
1816

1917
```hcl
2018
module "jfrog" {
2119
source = "registry.coder.com/modules/jfrog-oauth/coder"
2220
version = "1.0.0"
2321
agent_id = coder_agent.example.id
24-
jfrog_url = "https://jfrog.example.com"
22+
jfrog_url = "https://example.jfrog.io"
2523
username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username"
2624
package_managers = {
2725
"npm": "npm",
@@ -36,49 +34,7 @@ module "jfrog" {
3634
3735
## Prerequisites
3836

39-
Coder [`external-auth`](https://coder.com/docs/v2/latest/admin/external-auth) configured with Artifactory. This requires a [custom integration](https://jfrog.com/help/r/jfrog-installation-setup-documentation/enable-new-integrations) in Artifactory with **Callback URL** set to `https://<your-coder-url>/external-auth/jfrog/callback`.
40-
41-
To set this up,
42-
43-
1. Modify your `values.yaml` for JFrog Artifactory to add,
44-
45-
```yaml
46-
artifactory:
47-
enabled: true
48-
frontend:
49-
extraEnvironmentVariables:
50-
- name: JF_FRONTEND_FEATURETOGGLER_ACCESSINTEGRATION
51-
value: "true"
52-
access:
53-
accessConfig:
54-
integrations-enabled: true
55-
integration-templates:
56-
- id: "1"
57-
name: "CODER"
58-
redirect-uri: "https://CODER_URL/external-auth/jfrog/callback"
59-
scope: "applied-permissions/user"
60-
```
61-
62-
> Note
63-
> Replace `CODER_URL` with your Coder deployment URL, e.g., <coder.example.com>
64-
65-
2. Add a new [external authetication](https://coder.com/docs/v2/latest/admin/external-auth) to Coder by setting these env variables,
66-
67-
```env
68-
# JFrog Artifactory External Auth
69-
CODER_EXTERNAL_AUTH_1_ID="jfrog"
70-
CODER_EXTERNAL_AUTH_1_TYPE="jfrog"
71-
CODER_EXTERNAL_AUTH_1_CLIENT_ID="YYYYYYYYYYYYYYY"
72-
CODER_EXTERNAL_AUTH_1_CLIENT_SECRET="XXXXXXXXXXXXXXXXXXX"
73-
CODER_EXTERNAL_AUTH_1_DISPLAY_NAME="JFrog Artifactory"
74-
CODER_EXTERNAL_AUTH_1_DISPLAY_ICON="/icon/jfrog.svg"
75-
CODER_EXTERNAL_AUTH_1_AUTH_URL="https://JFROG_URL/ui/authorization"
76-
CODER_EXTERNAL_AUTH_1_TOKEN_URL="https://JFROG_URL/access/api/v1/integrations/YYYYYYYYYYYYYYY/token"
77-
CODER_EXTERNAL_AUTH_1_SCOPES="applied-permissions/user"
78-
```
79-
80-
> Note
81-
> Replace `JFROG_URL` with your JFrog Artifactory base URL, e.g., <artifactory.example.com>
37+
This module is usable by JFrog self-hosted (on-premises) Artifactory as it requires configuring a custom integration. This integration benefits from Coder's [external-auth](https://coder.com/docs/v2/latest/admin/external-auth) feature and allows each user to authenticate with Artifactory using an OAuth flow and issues user-scoped tokens to each user. For configuration instructions, see this [guide](coder.com/docs/v2/latest/guides/artifactory-integration#jfrog-oauth) on the Coder documentation.
8238

8339
## Examples
8440

@@ -89,8 +45,7 @@ module "jfrog" {
8945
source = "registry.coder.com/modules/jfrog-oauth/coder"
9046
version = "1.0.0"
9147
agent_id = coder_agent.example.id
92-
jfrog_url = "https://jfrog.example.com"
93-
auth_method = "oauth"
48+
jfrog_url = "https://example.jfrog.io"
9449
username_field = "email"
9550
package_managers = {
9651
"pypi": "pypi"
@@ -117,7 +72,7 @@ module "jfrog" {
11772
source = "registry.coder.com/modules/jfrog-oauth/coder"
11873
version = "1.0.0"
11974
agent_id = coder_agent.example.id
120-
jfrog_url = "https://jfrog.example.com"
75+
jfrog_url = "https://example.jfrog.io"
12176
username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username"
12277
configure_code_server = true # Add JFrog extension configuration for code-server
12378
package_managers = {
@@ -133,13 +88,14 @@ module "jfrog" {
13388
JFrog Access token is also available as a terraform output. You can use it in other terraform resources. For example, you can use it to configure an [Artifactory docker registry](https://jfrog.com/help/r/jfrog-artifactory-documentation/docker-registry) with the [docker terraform provider](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs).
13489

13590
```hcl
136-
13791
provider "docker" {
13892
...
13993
registry_auth {
140-
address = "https://YYYY.jfrog.io/artifactory/api/docker/REPO-KEY"
94+
address = "https://example.jfrog.io/artifactory/api/docker/REPO-KEY"
14195
username = module.jfrog.username
14296
password = module.jfrog.access_token
14397
}
14498
}
14599
```
100+
101+
> Here `REPO_KEY` is the name of docker repository in Artifactory.

jfrog-token/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,7 @@ module "jfrog" {
2727
}
2828
```
2929

30-
Get a JFrog access token from your Artifactory instance. The token must be an [admin token](https://registry.terraform.io/providers/jfrog/artifactory/latest/docs#access-token). It is recommended to store the token in a secret terraform variable.
31-
32-
```hcl
33-
variable "artifactory_access_token" {
34-
type = string
35-
sensitive = true
36-
}
37-
```
30+
For detailed instructions, please see this [guide](https://coder.com/docs/v2/latest/guides/artifactory-integration#jfrog-token) on the Coder documentation.
3831

3932
> Note
4033
> This module does not install `npm`, `go`, `pip`, etc but only configure them. You need to handle the installation of these tools yourself.

0 commit comments

Comments
 (0)