From 80925b876abbdfc79358d58b674f823306cb7f86 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 14 Nov 2023 01:36:09 +0300 Subject: [PATCH] update README --- jfrog-oauth/README.md | 50 ++++++------------------------------------- 1 file changed, 7 insertions(+), 43 deletions(-) diff --git a/jfrog-oauth/README.md b/jfrog-oauth/README.md index 71f0244..92a17cd 100644 --- a/jfrog-oauth/README.md +++ b/jfrog-oauth/README.md @@ -1,6 +1,6 @@ --- -display_name: JFrog -description: Install the JF CLI and authenticate with Artifactory +display_name: JFrog (OAuth) +description: Install the JF CLI and authenticate with Artifactory using OAuth. icon: ../.icons/jfrog.svg maintainer_github: coder partner_github: jfrog @@ -10,47 +10,7 @@ tags: [integration] # JFrog -Install the JF CLI and authenticate package managers with Artifactory. - -There are two ways to authenticate with Artifactory: - -1. Using an admin access token -2. Using OAuth configured via Coder [`external-auth`](https://docs.coder.com/docs/admin/external-auth/) feature. This is the recommended approach. - -Examples of both approaches are provided below. - -## Examples - -### Using an admin access token - -```hcl -module "jfrog" { - source = "https://registry.coder.com/modules/jfrog" - agent_id = coder_agent.example.id - jfrog_url = "https://YYYY.jfrog.io" - artifactory_access_token = var.artifactory_access_token # An admin access token - package_managers = { - "npm": "npm", - "go": "go", - "pypi": "pypi" - } -} -``` - -Get a JFrog access token from your Artifactory instance. The token must have admin permissions, i.e. with scopes = ["applied-permissions/admin"]. It is recommended to store the token in a secret terraform variable. - -```hcl -variable "artifactory_access_token" { - type = string - sensitive = true -} -``` - -![JFrog](../.images/jfrog.png) - -### Using OAuth - -You can use OAuth to authenticate with Artifactory. This is the recommended approach. To use OAuth, you must have the Coder [`external-auth`](https://coder.com/docs/v2/latest/admin/external-auth) configured with Artifactory. +Install the JF CLI and authenticate package managers with Artifactory using OAuth configured via Coder [`external-auth`](https://docs.coder.com/docs/admin/external-auth/) feature. ![JFrog OAuth](../.images/jfrog-oauth.png) @@ -68,3 +28,7 @@ module "jfrog" { } } ``` + +## Prerequisites + +- Coder [`external-auth`](https://docs.coder.com/docs/admin/external-auth/) configured with Artifactory. This requires a custom integration in Artifactory with **Callback URL** set to `https:///external-auth/jfrog/callback`.