From a985c414c078e2e33564e517fb8796f2c518c4cb Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 25 Jan 2024 13:33:10 +0300 Subject: [PATCH] docs(jfrog-oauth): improve docs Adds additional step and screenshot to show creating an OAuth app in JFrog platform --- jfrog-oauth/README.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/jfrog-oauth/README.md b/jfrog-oauth/README.md index f81d837..d34c6e1 100644 --- a/jfrog-oauth/README.md +++ b/jfrog-oauth/README.md @@ -10,18 +10,16 @@ tags: [integration, jfrog] # JFrog -Install the JF CLI and authenticate package managers with Artifactory using OAuth configured via the Coder `external-auth` feature. +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. -

- JFrog OAuth -

+![JFrog OAuth](../.images/jfrog-oauth.png) ```hcl module "jfrog" { source = "registry.coder.com/modules/jfrog-oauth/coder" version = "1.0.0" agent_id = coder_agent.example.id - jfrog_url = "https://jfrog.example.com" + jfrog_url = "https://example.jfrog.io" username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username" package_managers = { "npm": "npm", @@ -62,7 +60,10 @@ artifactory: > Note > Replace `CODER_URL` with your Coder deployment URL, e.g., -2. Add a new [external authetication](https://coder.com/docs/v2/latest/admin/external-auth) to Coder by setting these env variables, +2. Create a new Application Integration by going to and select the Application Type as the integartion you created in step 1. +![JFrog Platform New Integrtaion](https://github.com/coder/modules/assets/10648092/88a0d8c8-040a-4345-86c5-f3b8740122a5) + +3. Add a new [external authetication](https://coder.com/docs/v2/latest/admin/external-auth) to Coder by setting these env variables, ```env # JFrog Artifactory External Auth @@ -73,12 +74,11 @@ CODER_EXTERNAL_AUTH_1_CLIENT_SECRET="XXXXXXXXXXXXXXXXXXX" CODER_EXTERNAL_AUTH_1_DISPLAY_NAME="JFrog Artifactory" CODER_EXTERNAL_AUTH_1_DISPLAY_ICON="/icon/jfrog.svg" CODER_EXTERNAL_AUTH_1_AUTH_URL="https://JFROG_URL/ui/authorization" -CODER_EXTERNAL_AUTH_1_TOKEN_URL="https://JFROG_URL/access/api/v1/integrations/YYYYYYYYYYYYYYY/token" CODER_EXTERNAL_AUTH_1_SCOPES="applied-permissions/user" ``` > Note -> Replace `JFROG_URL` with your JFrog Artifactory base URL, e.g., +> Replace `JFROG_URL` with your JFrog Artifactory base URL, e.g., ## Examples @@ -89,8 +89,7 @@ module "jfrog" { source = "registry.coder.com/modules/jfrog-oauth/coder" version = "1.0.0" agent_id = coder_agent.example.id - jfrog_url = "https://jfrog.example.com" - auth_method = "oauth" + jfrog_url = "https://example.jfrog.io" username_field = "email" package_managers = { "pypi": "pypi" @@ -117,7 +116,7 @@ module "jfrog" { source = "registry.coder.com/modules/jfrog-oauth/coder" version = "1.0.0" agent_id = coder_agent.example.id - jfrog_url = "https://jfrog.example.com" + jfrog_url = "https://example.jfrog.io" username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username" configure_code_server = true # Add JFrog extension configuration for code-server package_managers = { @@ -133,13 +132,13 @@ module "jfrog" { 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). ```hcl - provider "docker" { ... registry_auth { - address = "https://YYYY.jfrog.io/artifactory/api/docker/REPO-KEY" + address = "https://example.jfrog.io/artifactory/api/docker/REPO-KEY" username = module.jfrog.username password = module.jfrog.access_token } } ``` +> Here `REPO_KEY` is the name of docker repository in Artifactory.